Title: Date time filter
Last modified: January 9, 2020

---

# Date time filter

 *  Resolved [rodboc](https://wordpress.org/support/users/rodboc/)
 * (@rodboc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/date-time-filter-2/)
 * Hi, I wonder if there is any chance to replace the choices on the Date filter
   for specific days?
 * The dropdown right now says something like
    Any date Today Tomorrow This week
   This week
 * And I would like to replace them for
    1st Feb 2nd Feb …
 * Any help?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Hitesh Makvana](https://wordpress.org/support/users/hiteshmakvana/)
 * (@hiteshmakvana)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12311162)
 * Hi [@rodboc](https://wordpress.org/support/users/rodboc/),
 * Yes, you can override template file “event-filters.php” to your theme side by
   following this doc [https://wp-eventmanager.com/template-files-override/](https://wp-eventmanager.com/template-files-override/)
 * Please replace the dropdown option with your value
    1st Feb 2nd Feb …
 * Thank you
 *  Thread Starter [rodboc](https://wordpress.org/support/users/rodboc/)
 * (@rodboc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12311243)
 * Thanks [@hiteshmakvana](https://wordpress.org/support/users/hiteshmakvana/), 
   any idea how to get it done? I can go to the template but after that I’m clueless
 *  [Hitesh Makvana](https://wordpress.org/support/users/hiteshmakvana/)
 * (@hiteshmakvana)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12314389)
 * Hi [@rodboc](https://wordpress.org/support/users/rodboc/),
 * You just need to create folder called **wp-event-manager** in your child theme
   and override template file called “event-filters.php”.
    [https://wp-eventmanager.com/template-files-override/](https://wp-eventmanager.com/template-files-override/)
 * Inside this file please find the date and time filter code
 *     ```
       <?php foreach ( $datetimes as $key => $value  ) :
       						if(!strcasecmp($selected_datetime, $value) || $selected_datetime==$key) : ?>
       							<option selected=selected  value="<?php echo $key !='datetime_any' ? $key : ""; ?>" ><?php echo  $value; ?></option>
       						<?php else : ?>
       							<option value="<?php echo $key !='datetime_any' ? $key : ""; ?>" ><?php echo  $value; ?></option>
       						<?php endif;						
       					 endforeach; ?>
       ```
   
 * please replace this code with following code :
    <option value=”1feb” >1st feb
   </option> <option value=”2feb” >2nd feb</option> <option value=”3rd” >3rd feb
   </option>
 * After creating custom value in dropdown please apply those value filter by following
   this doc
    [https://wp-eventmanager.com/add-custom-field-in-search-filter/](https://wp-eventmanager.com/add-custom-field-in-search-filter/)
 * Thank you
 *  Thread Starter [rodboc](https://wordpress.org/support/users/rodboc/)
 * (@rodboc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12331575)
 * Thanks for your answer Hitesh but actually the code you posted is not filtering
   properly by date. Should I change the option value for something like “20200201”
   yyymmdd ?
 *  [Hitesh Makvana](https://wordpress.org/support/users/hiteshmakvana/)
 * (@hiteshmakvana)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12334990)
 * Hi [@rodboc](https://wordpress.org/support/users/rodboc/),
 * May be you are not adding proper value or condition in meta key if you want to
   filter date from database then format of database date and time will be d-m-Y
   h:i:s.
 * I would suggest you to convert your 1feb to <option value=”01-02-2020” >1st feb
   </option>
 * Thank you
 *  Thread Starter [rodboc](https://wordpress.org/support/users/rodboc/)
 * (@rodboc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12338489)
 * Thanks Hitesh, but it is not working after the last changes. My code looks like
   that
 *     ```
       <?php if ( $datetimes) : ?>
       <div class="wpem-form-group">
          <label for="search_datetimes" class="wpem-form-label"><?php _e( 'Any dates', 'wp-event-manager' ); ?></label>
          <select name="search_datetimes[]" id="search_datetimes" class="event-manager-category-dropdown" data-placeholder="Choose any date…" data-no_results_text="No results match" data-multiple_text="<?php _e('Select Some Options','wp-event-manager'); ?>" >
          <option value=”01-02-2020 00:00:00” >1st feb</option>
          <option value=”01-02-2020” >1st feb</option>
          </select>
       </div>
       <?php endif; ?>	 
       ```
   
    -  This reply was modified 6 years, 4 months ago by [rodboc](https://wordpress.org/support/users/rodboc/).
 *  [Hitesh Makvana](https://wordpress.org/support/users/hiteshmakvana/)
 * (@hiteshmakvana)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12356891)
 * Hi [@rodboc](https://wordpress.org/support/users/rodboc/),
 * Once you have made changes in the template file you need to filter events by 
   your custom value by following this doc [https://wp-eventmanager.com/add-custom-field-in-search-filter/](https://wp-eventmanager.com/add-custom-field-in-search-filter/)
 * Thank

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Date time filter’ is closed to new replies.

 * ![](https://ps.w.org/wp-event-manager/assets/icon-256x256.png?rev=1622826)
 * [WP Event Manager – Events Calendar, Registrations, Sell Tickets with WooCommerce](https://wordpress.org/plugins/wp-event-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-event-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-event-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-event-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-event-manager/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Hitesh Makvana](https://wordpress.org/support/users/hiteshmakvana/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/date-time-filter-2/#post-12356891)
 * Status: resolved