Do you need to modify the date picker text for Months (long and short)? Perhaps you’d like to show a different language in your date picker. This tutorial will show you how to change this text using PHP.
By default, the Date Picker calendar strings are in English and the first day of the calendar week will be Sunday.
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.
You’ll need to copy the code below and add it to your site. Then modify the language to match what you need.
If you need help in how and where to add snippets to your site, please check out this tutorial.
Now when you view your Date Picker dropdown, you’ll see the changes instantly.
Alternatively, you could also translate the dte picker using a library from a script, simply follow the steps in this documentation as well.
And that’s it! You’ve successfully updated the string for the Date Picker months. Would you like to further customize the Date / Time field? Take a look at our article on How to Customize the Date Time Field Date Options.
Action Reference: wpforms_wp_footer