1

Have a mobiscroll instance to show date:

        $(document).ready(function () {                               
                $("#date").mobiscroll().date({
                    theme: 'wp',
                    mode: 'clickpick',
                    onChange: function (ins) {
                        console.log(JSON.stringify(ins));
                    }
                });
            });

Currently the datepicker displayed in the format like: dd/mm/yyyy How can swap the order be to see mm/dd/yyyy ?

Zoltan Veres
  • 355
  • 5
  • 27
Raphael
  • 770
  • 1
  • 7
  • 23

1 Answers1

1
$(document).ready(function () {
    $("#date").mobiscroll().date({
        theme: 'wp',
        mode: 'clickpick',
        onChange: function (ins) {
            console.log(JSON.stringify(ins));
        },
        dateFormat: 'mm/dd/yyyy'
    });
});

Here's the link for more info:

https://docs.mobiscroll.com/3-1-0/jquery/datetime#!localization-dateFormat

Zoltan Veres
  • 355
  • 5
  • 27
  • Investigation shown dateFormat parm sets date of the input field, however in my instance solution was setting the lang param as: $(document).ready(function () { $("#date").mobiscroll().date({ lang: window.navigator.language || window.navigator.userLanguage, theme: 'wp', mode: 'clickpick', onChange: function (ins) { console.log(JSON.stringify(ins)); }, dateFormat: 'mm/dd/yyyy' }); }); – Raphael Apr 23 '17 at 12:45