I'm trying to order some data by date, although the dates are just strings, in the format dd-mm-yyyy.
I made a filter which converted the plain string of numbers (which where in the US date format, where I wanted the UK date format) e.g 01272012 to 27-01-2014, but when I try to order them it still only sees them as numeric strings, so 01-01-1990 would come before 02-01-2014.
Any suggestions of how to do this in a filter?
Thanks!
Update
I figured out the dates would automatically get orderedif the date format was yyyy-mm-dd. I then used used orderBy:['date']
to order the data, only using my original filter when displaying the data.
I ended up having to reverse my data, showing the most recent dates. To achieve this I added a -
to my orderBy statment: orderBy:['-date']
.