Search code examples
javascriptjqueryjquery-uijquery-ui-datepicker

datepicker won't change date format


I'm trying to change the date format for my datepicker, but it doesn't want to change, here is my code:

$(document).ready(function() {
    $('#dateselect').datepicker({
        format: 'dd/mm/yyyy',
        onSelect : function (dateText, inst) {
        $('#dateform').submit(); // 
    }});
});

even so, the format on the front end is still mm/dd/yyyy


Solution

  • Assuming you are using the jQuery UI Datepicker widget, the way to change the date format is

    dateFormat
    

    and not

    format
    

    See http://api.jqueryui.com/datepicker/#option-dateFormat