Forums › Forums › Search & Filter Pro › Filter by ACF Date >= InputDate
Tagged: date acf
- This topic has 5 replies, 2 voices, and was last updated 7 years, 10 months ago by Trevor.
-
Anonymous(Private) February 19, 2017 at 8:41 pm #91285
Hi Trevor,
You raise a point I am still considering, but I need to manage client expectations in the mean time. Currently about 65% of the events are single day so an if acf-start-date >= entered-date will cover these.
My other problem is more complicated in that a single event can cover various date ranges, it is implemented an an ACF Repeater with individual start and end dates for each valid range, an example if a produce market which is the first saturday of each month
Start_End_Dates
Row0->StartDate 20170304 EndDate 20170304
Row1->StartDate 20170401 EndDate 20170401There are examples where individual row start and end dates are not on the same day so nothing can be assumed. Once this is sorted I am intending on providing the option to enter a date-range and all events that are on in that period.
I was/am intending to contact D&C regarding a paid development to cater for these requirements and was finalising the criteria I require – if you support these types of requests that is (dont mean to sound presumptuous). I am happy for the result to be part of your product ongoing.
In the mean time a comparatively straight forward >= start-date will buy me time.
Thanks, Dean
Trevor(Private) February 19, 2017 at 9:39 pm #91302Search & Filter does not support repeater fields. There will be PHP coded ways around this, but you need to understand this limitation.
Considering what you have said above, I would have considered storing dates as individual dates (an array), but the only array fields allowed in ACF are textual ones. You might find it an idea to create a custom text field and place an ACF date value in this and request S&F to try a date match with this.
Placing multi values in text fields is, I think, possible within ACF (you would have to check field types to see which allows multi values), and certainly supported by ACF in the search. It might work. Worth checking at this stage I think.
As to the question of custom development work, it is not something that we are able to offer, I am sorry about that.
Anonymous(Private) February 20, 2017 at 5:06 am #91342Thanks Trevor, I understand S&F doesn’t support repeater fields. The use of ACF was driven by other requirements, but as you have pointed out we could introduce a standard custom field that stores the date array. In the mean time given current implementation I am referencing the first start date sub field directly in S&F and I can sucessfully complete filters so events on the user-selected dates is possible. Are you able to provide advice as to how this could be made >= rather than == ?
Thanks, Dean
Trevor(Private) February 20, 2017 at 8:44 am #91367The only avenue I can think of is to see if you can use our Edit Query Arguments filter.
I have never used meta key operators in this way, but this reference might help:
-
AuthorPosts