Skip Navigation

[Resolved] Hide Datelist value in relation of actual date

This thread is resolved. Here is a description of the problem and solution.

Problem: How to filter the posts by custom date field having past date

Solution: You should create a block view or classic view and to the Query filter section, you should try to add the custom filter for your date custom field and select the comparison as Number and grater than PAST_DAY and input the value 2.

You can find the proposed solution, in this case with the following reply: => https://toolset.com/forums/topic/hide-datelist-value-in-relation-of-actual-date/#post-1611737

Relevant Documentation: => https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/ => https://toolset.com/documentation/user-guides/views/date-filters/

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by thomasB-2 4 months, 2 weeks ago.

Assigned support staff: Minesh.

Author
Posts
#1610267

We try to manage a company with it trainings with formidable. We have created a CPT "trainings".
These trainings are managed once in a month, so we have a list of date like
01.05.2020
03.06.2020
02.07.2020
06.08.2020

Question for us was as it possible to limit the shown value for these dates to only actual values. Means dates wich are in past could be automatically hided related with a rule "2 Days before Actual date".

So in the list on top actual will show 3 Dates starting from 03.06.2020, because the first date (01.05.2020) was not in that condition (Todaydate ( 04.05.2020) - 2Days = 02.05.2020).
Means Values:
01.05.2020 (in Past)
03.06.2020
02.07.2020
06.08.2020

Was that possible?

#1611737

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand, you have a custom date field added using Types plugin and you want to filter your posts by that date custom field.If this is correct - yes, you can filter your posts by a custom date field.

You should create a block view or classic view and to the Query filter section, you should try to add the custom filter for your date custom field and select the comparison as Number and grater than PAST_DAY and input the value 2.

Datefield is a number greater than PAST_DAY(2)

Screenshot: hidden link

More info:
=> https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/
=> https://toolset.com/documentation/user-guides/views/date-filters/

#1618763

My issue is resolved now. Thank you!