Sorting asset listing of calendar events

I have an asset listing of a subset of calendar events that I'm trying to sort by date/time keyword, such as event_start_datetime, but it's not working. Rather than treating the date as a date, it appears to treat the date as a sequence of numbers and letters and sorts the assets based on that. For example,


14th Feb 2012 6:00pm-8:30pm

23rd Feb 2012 3:45pm-5:15pm

31st Mar 2012 8:30pm-9:30pm

4th Feb 2012 9:00am-11:00am



Is this a known issue, and if so, what is the workaround?

Yes, it will use the string representation of the start date to naturally sort it.


But the format it uses should be like this '2012-02-09 16:58:00'. It is the default format of any date time attribute of Matrix assets, including the start date of Single Calendar Event. It's not the English language format you see in the backend.



This default format allows PHP asort() function to sort it correctly, unless you customized the format of the string and that could cause the problem.

Listing page sorting treats the keyword replacement value simply as string. You can use the keyword "asset_attribute_start_date" instead for sort by option, which returns datetime in YYYY-MM-DD hh:mm:ss format, to get the expected result.

thanks to you both for your prompt responses, the "asset_attribute_start_date" sort by option works beautifully.

[quote]

Listing page sorting treats the keyword replacement value simply as string. You can use the keyword "asset_attribute_start_date" instead for sort by option, which returns datetime in YYYY-MM-DD hh:mm:ss format, to get the expected result.

[/quote]