CMS MADE SIMPLE FORGE

ListItExtended

 

[#9985] Cannot sort by custom date field

avatar
Created By: Oliver Coningham (aztecmedia)
Date Submitted: Thu May 08 12:06:40 -0400 2014

Assigned To: Tapio Löytty (Stikki)
Version: 1.4
CMSMS Version: 1.11.9
Severity: Major
Resolution: Won't Fix
State: Open
Summary:
Cannot sort by custom date field
Detailed Description:
I have a ListIt that I'm using to show Client Testimonials. I have a custom
field called 'date_written' that allows the user to select a date (using the
date picker) that the testimonial was written.

I'm trying to sort the ListIt on the frontend using the sortby attribute:

{cge_module_hint module='ListIt2Comments' category='dove-house'
orderby='custom_date_written|ASC'}

However it only seems to read and sort by the first part of the date, so the day
number in my case, rather than the whole date. So I have something like:

01-01-2013
01-12-2012
03-05-2013
24-05-2013
25-04-2014

Any ideas on how to fix/solve this?

Thanks!


History

Comments
avatar
Date: 2014-05-08 12:53
Posted By: Tapio Löytty (Stikki)

Directly from first page of help:

Also, each bit of data you enter is stored as TEXT data type, regardless of
whether it is varchar, boolean, timestamp, etc.

Nothing i can do.
      
avatar
Date: 2014-05-08 13:02
Posted By: Goran Ilic (uniqu3)

Sorting works, but you date formats are wrong, therefore use proper format which
can be sorted as values aren't save as a timestamp, like Stikki mentioned.
Use a formatting for date like Y-m-d, in example if you are using Select
DateTime field you should speficy yy-mm-dd as format, if using time values as
well add HH:mm

Output in template can be easily formatted with date_format modifier.
      
Updates

Updated: 2014-05-08 12:53
resolution_id: => 8
assigned_to_id: 100 => 11306