Skip Navigation

[Resolved] Filter post by time

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Shane 6 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#912924

Hi, there.... thanks for this ticket..

https://toolset.com/forums/topic/filter-post-with-datetime/

I want some help... At the latest ticket, I want to filter post by promote start and promote end... it will filter by date and it's worked... same concept like latest ticket but I want to filter by date and time... means, the post will display if promote start lower than or equal and promote end is greater than now...

#913113

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jack,

Thank you for contacting our support forum.

Is it that you want to allow users to enter the date and time they want to filter by? Is this for a parametric search?

If so then you can just add the filter by going to the filter section of your view and clicking on New Filter.

Add the custom field with the date time. I'm assuming that the start and end time are 2 different custom fields. Unfortunately you can only do a between for 1 field.

So you will need to do a between for the start time and a between for the end time. This way the user can filter lets say they want posts between Filter A and Filter B.

Please let me know if this is clear.

Thanks,
Shane

#913246
datetime.PNG
filter.PNG

Hi, Shane....

What I mean is we filter the post on View... not in frontend... Like the ticket that I'm included... I want filter the post in View... means on backend.... I want it display post if promote start lower than or equal NOW() and promote end greater than NOW()... promote start and promote end is a fields on post....

The datetime.PNG is a field of promote start and promote end... the filter.PNG is a filter that I've made before but it filter by Today().... I want to filter by NOW()...

It's any method to make it?

#913488

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jack,

Still not understanding fully, because your screenshot of the filter should give the desired results.

You're not able to filter by time only but by the entire datetime .

Is the filter not working ?

Thanks,
Shane

#916153

The filter is working....

What I means is, I want to filter a data by time... the type of field for promote start is datetime.... same also for promote end...

Example, a promote start is 27 March 2018, 8.30pm and promote end is 27 September 2018, 1.25pm..... so, if today is 20 May 2018, 9.00am, it will displayed.... but if today is 27 September 2018, 5.00pm, it will not displayed...

Any method for this things?

#916266

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jack,

So essentially you want a time filter separate from a date filter?

Unfortunately no that isn't possible. However if you do have a datefilter it should have the time picker as well.

So it is essentially 1 filter but just with the time picker added. Would you mind providing me with access to look at this for you ?

The private fields have been enabled.

Thanks,
Shane