1. Home
  2. Snippets
  3. Modify Date field date picker strings

Modify Date field date picker strings

Heads up!

This article contains PHP and javascript code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

For extra guidance, please see WPBeginner's tutorial on adding custom code.


The WPForms Date Picker is generated using the Flatpickr date script, which builds the date picker using JavaScript. By default, the Date Picker calendar strings are in English and the first day of the calendar week will be Sunday.

Default Date Picker settings in WPForms

If you’d like to localize the language strings used in the Date Picker, we have a separate tutorial with more details.

By adjusting the code below, you can modify or translate the strings used for days and months in the calendar, as well as adjust the first day of the week.

In this example, we’ve translated the days and months into French and also changed the first day of the week to Monday.

 * Translate strings for WPForms date picker and modify first day of week.
function wpf_dev_datepicker_strings() {
	<script type="text/javascript">
	window.wpforms_datepicker = {
        disableMobile: true,
	 	locale: {
	    	firstDayOfWeek: 1,
	    	weekdays: {
	      		shorthand: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
        		longhand: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
		    months: {
		      shorthand: ['Janv', 'Févr', 'Mars', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sept', 'Oct', 'Nov', 'Déc'],
			  longhand: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre']
add_action( 'wpforms_wp_footer', 'wpf_dev_datepicker_strings' );

Modified Date Picker settings in WPForms

Updated on June 12, 2019

Was this article helpful?