Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Shae

Custom filtering current date.

Is there a way to save a segment with the filter being Date is after (current date) instead of actually choosing a date?

I have a CPT for Events. I would like a segment to be able to show only future events in the order of next upcoming events.

5 years, 2 months ago
Tobias Schutter
Developer

Currently, there is no such option, but I see why a “future/past” date condition would be useful. I think it would make sense for a date to have two extra options: past and future dates, especially in combination with segments.

Thanks for the input, I will look into it a bit further and see if we can ship this in an upcoming release.

Cheers, Tobias

5 years, 2 months ago
Philippe

Did this feature ever make it into ACP?
Thanks, Phil

2 years, 2 months ago
Stefan van den Dungen Gronovius
Developer

Yes, many of our date columns do have the future and past date filters. Even filters like x days ago and today are operators that are available for the date columns. This is a feature in our Smart Filtering feature, not the filter feature with the default drop downs on the table.

2 years, 2 months ago
Shae

Hey @stefan This doesn’t seem to be the cast for ACF Date fields. Is there any want to set a default smart filter based on ACF date field?

2 years, 2 months ago
Stefan van den Dungen Gronovius
Developer

@Shae
You’re right, this is currently not implemented for both the ACF Date and Date-Time fields.
For the Date Time fields, there is a simple workaround that works by changing the following file:

ac-addon-acf/classes/Fields/DateTimePicker.php

The search method should become this:

public function search() {
	return new ACP\Search\Comparison\Meta\DateTime\ISO( $this->get_meta_key(), $this->get_meta_type() );
}

It will be patched in the next version. We’ll have another look at the date field since this must be written specifically for the ‘uncommon’ ACF date format.

2 years, 2 months ago

You must be logged in to reply to this topic.