Changing 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:
dmy
- dd/mm/yyyydmy_dash
- dd-mm-yyyydmy_dot
- dd.mm.yyyymdy
- mm/dd/yyyy (default)ymd_slash
- yyyy/mm/ddymd_dash
- yyyy-mm-ddymd_dot
- yyyy.mm.dd
To modify the format, install one of the plugins below:
At the bottom of this article are plugins you can install that change 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
- Download
dmy
plugin - Download
dmy_dash
plugin - Download
dmy_dot
plugin - Download
mdy
plugin - Download
ymd_dash
plugin - Download
ymd_dot
plugin - Download
ymd_slash
plugin
For developers:
To modify the format, use the gravityview/widgets/search/datepicker/format
filter. This modifies the CSS class for the date picker input fields, which is used to determine the format for the date picker.
function modify_gravityview_search_datepicker_format( $format ) { return 'mdy'; // <-- Change this to one of the date format options above } add_filter( 'gravityview/widgets/search/datepicker/format', 'modify_gravityview_search_datepicker_format' );