Forums › Forums › Search & Filter Pro › Date Range
Tagged: date range, event
- This topic has 5 replies, 3 voices, and was last updated 9 years, 11 months ago by
Ross.
-
Ross Moderator(Private) September 28, 2015 at 10:58 am #26009
Hey Kostas
I added in the functionality to compare between 2 date fields for start/end – however I overlooked this kind of setup – I had another user I was working with on this mention it too, that she requires the same functionality you describe – so I’m looking to add it in soon.
Most of the hard work has been done by allowing a second meta key to be used for the end date – its now getting this query just right.
Thanks
Anonymous(Private) September 28, 2015 at 12:10 pm #26041I’m also looking for this feature but with ‘date range’ or ‘individual days’. I have made a lot of pages with this feature. For performances, classes, theater… many times are date range (all days) but other times are certain days.
Then I have ACF with:
– Date range: ‘start date’ and ‘end date’
– Individual days: repeater with ‘days’And a radio button to select between ‘date range’ or ‘individual days’.


And I’m using this SQL query:
.... ( ( $wpdb->postmeta.meta_key = 'date_start' AND CAST($wpdb->postmeta.meta_value AS DATE) BETWEEN '".$date_start."' AND '".$date_end."' ) OR ( $wpdb->postmeta.meta_key = 'date_end' AND CAST($wpdb->postmeta.meta_value AS DATE) BETWEEN '".$date_start."' AND '".$date_end."' ) ) OR ( ( $wpdb->postmeta.meta_key = 'date_start' AND CAST($wpdb->postmeta.meta_value AS DATE) <= '".$date_start."' ) AND ( mt1.meta_key = 'date_start' AND CAST(mt1.meta_value AS DATE) >= '".$date_end."' ) ) OR ( $wpdb->postmeta.meta_key LIKE 'individual_days_%_day' AND CAST($wpdb->postmeta.meta_value AS DATE) BETWEEN '".$date_start."' AND '".$date_end."' ) )";Ross Moderator(Private) November 25, 2015 at 3:50 pm #30748Hey Kostas
Please try the update I just sent 🙂
There is a new compare option for your range fields.
Let me know if it makes sense, or you have any suggestions as to the wording of this new option (I think its a little confusing).
Thanks
-
AuthorPosts