How do I change the format of the search widget's date picker?

By default, GravityView formats dates in the US format of mm/dd/yyyy. If you would like to change that, you can.

Date format options are:

  • mdy - mm/dd/yyyy
  • dmy - dd/mm/yyyy
  • dmy_dash - dd-mm-yyyy
  • dmy_dot - dd.mm.yyyy
  • ymp_slash - yyyy/mm/dd
  • ymd_dash - yyyy-mm-dd
  • ymp_dot - yyyy.mm.dd

To modify the format, see the attached plugins

At the bottom of this article are plugins you can install that modify the format for you.

  • Refer to the name of the plugin to see what date format will be applied
  • Download the plugin you want
  • Install and activate the plugin on your website
  • The date format will be modified

For developers:

To modify the format, use the gravityview_search_datepicker_class filter. This modifies the CSS class for the datepicker input fields, which is used to determine the format for the date picker.

function modify_gravityview_search_datepicker_class( $existing_class ) {
	$format = 'mdy'; // CHANGE THIS TO THE FORMAT YOU WANT
	return 'gv-datepicker datepicker '.$format;
}
add_filter( 'gravityview_search_datepicker_class', 'modify_gravityview_search_datepicker_class');