I would have thought this was:
.datepicker({ dateFormat: 'dd-mmm-yyyy' });
for month, I get some number that I don't understnad where they are coming from?
inside the jQuery script code just paste the code. $( ". selector" ). datepicker({ dateFormat: 'yy-mm-dd' });
var year = 2014; var month = 5; var day = 10; var realDate = new Date(year, month - 1, day); // months are 0-based! $('#MainContent_txtDataConsegna'). datepicker({ dateFormat: 'dd/mm/yyyy' }); // format to show $('#MainContent_txtDataConsegna'). datepicker('setDate', realDate);
Right click on datepicker box. Select 'inspect' (Ctrl+Shift+I) in Chrome or 'inspect element' (Q) in Firefox. Find the CSS style that you want to change.
According to the documentation, a single M is "Month name short" and "yy" is "Four Digit Year."
dd-M-yy
This is a case where looking into the documentation is most helpful:
* d - day of month (no leading zero) * dd - day of month (two digit) * o - day of the year (no leading zeros) * oo - day of the year (three digit) * D - day name short * DD - day name long * m - month of year (no leading zero) * mm - month of year (two digit) * M - month name short * MM - month name long * y - year (two digit) * yy - year (four digit) * @ - Unix timestamp (ms since 01/01/1970) * '...' - literal text * '' - single quote * anything else - literal text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With