S
S
Sergey2015-11-26 14:43:46
MODX
Sergey, 2015-11-26 14:43:46

How to implement sorting of resources by date in tv parameter?

Task:
Filter out documents whose date is LESS than the current one. The date of the documents is specified in TV - date-event
I compared this TV with a snippet that takes the current date:

<?php
echo date("j-n-Y H:m:s");

Did it like this:

As a result, NOTHING is output. The only thing I achieved - if you put UNEQUAL <=> then ALL resources are displayed.
Thank you for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-26
@Derzaiii

Figured it out myself.
It turned out that the dates were displayed in different formats.
In the filter, TV displayed the date in the format:
I corrected the format in the snippet and it all worked:

<?php
echo date("Y-m-j" ." ". "H:m:s");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question