Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Date Range

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • KOSTAS KONTOS
    #25945

    Hi Ross

    I’m making an event site and I’m usign ACF for the custom fields and your plugin for filtering.


    I’m usign different custom fields for start and end dates.

    Each event is taking place on more than one dates (example 1st event from 4/8/2015 since 15/8/2015 2nd event from 8/8/2015 since 20/8/2015).So the events are overlap in dates each other.

    I would like to ask you if is possible with the new version to do the following logic:
    If start_date is between the selected start/end date OR end_date is between the selected start/end date then show the result.

    I was post again but the topic was labeld as [Resolve] so I’m bring it back.

    Thanks
    Kostas

    Ross Moderator
    #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

    KOSTAS KONTOS
    #26018

    Ok, thanks Ross, I’m waiting for this feature.

    Jose David Moliner
    #26041

    I’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’.

    1

    2

    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."' ) 
         )";
    KOSTAS KONTOS
    #30560

    Hi Ross, is there any progress with this feature?

    Thanks
    Kostas

    Ross Moderator
    #30748

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Date Range’ is closed to new replies.