https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


Date Sorting

More
13 years 11 months ago #909

Hello,

I have recently picked up a task of sorting a grid view date.
The date is displayed as Gregorian, where the sorting becomes Alpha Numeric.
Any tips on this would be greatly appreciated.

**EDIT**
Sorry will be more specific.

I have a grid table display with multiple columns,
One of which is a Date Column.
The view is setup with DATE_FORMAT, where the database column is a mysql date format.

So the database table fields would be
2010-12-25 | TEXT | TEXT

The Generated view is DATE_FORMAT(datecol, '%M %Y') AS myDATE
Which Displays
December 2010 | TEXT | TEXT

Upon sorting the column in the display the dates are sorted Alphabetically instead of by Date.

Is there a way to sort it by date, rather than alphabetic?

Last edit: 13 years 11 months ago by fyrye.

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #910

I have been thinking about it. The best approximation you could get without great effort would be this: you can include numeric date format in your view and then set it as default sort field. You do not need to display this field on your page. So when your table is loaded it is sorted by date, but if you click to sort on any column this sorting would lost.

You can also try using secondary order by if you find it useful.

Regards

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #995

Hi, this isn't related directly to the question here, but it does have to do with date sorting. Take a look at the table view here:http://offnrunningsports.com/index.php?option=com_content&view=article&id=48&Itemid=57

Why is it sorting the year 2012 before 2011??? I have it sorting in ascending order, which means that 2011 comes before 2012!

Thanks.

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #1026

Hi,

It appears that it sorts alphabetically. Does it work if you use a default format?

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.156 seconds

Contact Us

Contact us on Discord

Contact us on Facebook