Query between dates using date picker filter breaks in WordPress 4.2.1

There’s no need for the custom meta SQL filter – the beauty of storing dates in the format Ymd is that you can treat them numerically, and MySQL will still be able to find events in a given “range” and sort them ascending/descending. I’ve done this recently on another site using ACF for start/end date: … Read more

Min And Max Date With Date Format In Elementor Form Not Working

You are using this flatpickr, right? So I don’t use Elementor and therefore, I haven’t tested this with Elementor or an Elementor form. However, from what I could see, all you need to do to make both the minDate and dateFormat work, is add this: if ( self.settings.dateFormat ) { pickerSettings.dateFormat = self.settings.dateFormat; } above … Read more

Set default date in datepicker of an advanced custom field

It depends on the datepicker plugin you are using. Mostly all datepickers will have a default value you can play with. Usualy it is set within the input text type that hosts the datepicker. <input type=”text” class=”datepicker” default-value=”2013/07/25″> And in wordpress’ php you can do : <input type=”text” class=”datepicker” default-value=”<?php echo date(“Y/m/d”); ?>”>

Add jQuery UI datepicker to admin panel

maybe you include your scripts ui-core and picker too early. Use wp_enqueue script() to include on the right hook. You must not include ui-core, only datepicker! example: wp_enqueue_script( ‘jquery-ui-datetimepicker’, \ $this->get_plugins_url( ‘js/ui.datetimepicker.js’, __FILE__ ), \ array(‘jquery-ui-core’) , 0.1, TRUE );` any tutorials: http://wpengineer.com/415/use-javascript-libraries-in-and-of-wordpress/ http://codex.wordpress.org/Function_Reference/wp_enqueue_script http://wpengineer.com/2028/small-tips-using-wordpress-and-jquery/ I use the datepicker on different plugins and works fine, … Read more

Query between dates using Date Picker fields

The Codex lists all of the comparison options on the WP_Query page. If you want events with a start date BETWEEN a range of dates, OR events with an end date BETWEEN a range of dates, something like this should work – ‘relation’ => ‘OR’, array( ‘key’ => ‘event_start_date’, ‘value’ => array( $beginning_of_range, $end_of_range ), … Read more

Add `datetimepicker` to form

You can try this. add_action( ‘wp_enqueue_scripts’, ‘wpcustom_enqueue_script’ ); function wpcustom_enqueue_script() { wp_enqueue_style( ‘datepicker-style’, ‘https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css’ ); wp_enqueue_script( ‘js-datepicker’, ‘https://code.jquery.com/ui/1.12.1/jquery-ui.js’, array(‘jquery’), null, true); } Readmore: http://jqueryui.com/datepicker/