tvFilter by part of the Date

Hi there,

I just kind of finished a snippet to filter results of PdoTools (calendar entries) by things like “country” and “type” etc. which users can choose in a dropdown form (formIt).

What I need now is a way to filter my “month and year”, like “may 2020”. All I have is the full timestamp of the event.

How would you set a tvFilter for this?

1 Like

You can convert the timestamps into whatever date format you want, here are some links HTH


Thank you for your Input!

The links you provided are about the display of the timestamp / date. What I need is a comparism of a form input (one month / one year / both) and a database field containing a full timestamp. I think that the format of the timestamp is always the same within the MODX database.

does this help?

1 Like

I created a custom snippet for creating the tvFilter. I can publish it later when thenI finished the function in the project. Have to hurry a bit, holydays are calling and I have to get ready :slight_smile:

1 Like

By the way:
Does not work woth pdoResources. You need to do it like this:

1 Like