• Hi,
    I try to use Contact Form 7 with a simple date field, and I would like to have a date picker.

    As recommended in the FAQ I added the fallback code: add_filter( ‘wpcf7_support_html5_fallback’, ‘__return_true’ ); to the functions.php file of my theme.
    And it works.
    But the calendar pickup is in English.

    how to have calendar UI for the date field in french ?

    Thanks

    https://wordpress.org/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
  • There is no settings available directly in Contact Form 7 that allows you to change the language of a date picker. It can be done via custom programing but you would need to be rather skilled at WordPress development using and jQuery codding.

    This thread could be of help Jquery date picker

    Thread Starter ppi37

    (@ppi37)

    Hi,
    with the following code in the header.php of the theme, the date picker is in french.

    <script type=”text/javascript”
    src=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/i18n/jquery.ui.datepicker-fr.js”&gt;
    </script>

    But now the date is in english format.

    Someon know how to have the in french format (jj/dd/yyyy or jj-dd-yyyy)
    Thanks

    In footer.php, before </body> add following code:

    <script type="text/javascript">
            var $ = jQuery;
            jQuery(document).ready(function() {
                var $ = jQuery;
                $(this).find('input.wpcf7-date[type="date"]').each(function() {
                    $(this).datepicker( "option", "dateFormat", "dd/mm/yy" );
                });
            });
        </script>

    Unfortunately contact form 7 wrong date validation, so I’ve removed it by the addition of this row in functions.php:

    remove_filter( 'wpcf7_validate_date', 'wpcf7_date_validation_filter', 10, 2 );
    remove_filter( 'wpcf7_validate_date*', 'wpcf7_date_validation_filter', 10, 2 );

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘date field in french format’ is closed to new replies.