Hi,
I am sorting by a date tv, it works fine, but past dates are shown at the top, I need to push them to bottom of the list somehow, is this possible?
[[!getResources? &parents=`103` &limit=`4` &tpl=`homeEventTpl` &sortbyTV=`eventStartDate` &sortdirTV=`ASC` &includeTVs=`1` &processTVs=`1` ]]
Change the sortDirTV to DESC = descending (from biggest to smallest) where ASC is ascending from smallest to biggest
thanks Dunnock, but that will then show the older events first.. I need to show the latest events first, and put the past events last.
Does not compute, it should show newest date first when ordering in descending order
ASC is correct because with a date nearest is first.
MySQL date sorting, or general SQL sorting actually:
Dates sorted in ASC
2001-02-02
2012-02-02
2020-02-02
Dates in DESC order
2020-02-02
2012-02-02
2001-02-02
DESC is the default, so if you leave out the &sortDirTV property, you should get the newest ones first, unless the TV values are incorrect.
Thanks Bob, but doing that (for me at least) shows the oldest (i.e furthest away) events first.
My TV has date set as input and output with the following format:
My code works fine and displays in the correct order, it just if the date has passed it is still shown before upcoming events, I need it to go to the back of the queue.
Could you give an example of the order in which you want dates sorted?
eg:
2013-08-12
2013-06-02
2013-04-14
2013-03-30
2013-03-29
sorry, yes:
1 August, 2013
6 August, 2013
26 August, 2013
Then the events that have happened:
27 July, 2013
26 June, 2013
right now it looks like this:
27 July, 2013
26 June, 2013
1 August, 2013
6 August, 2013
26 August, 2013