Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i format jquery datepicker as "25-JAN-2009"

Tags:

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?

like image 604
leora Avatar asked Jan 13 '10 14:01

leora


People also ask

How do I change date format in datepicker?

inside the jQuery script code just paste the code. $( ". selector" ). datepicker({ dateFormat: 'yy-mm-dd' });

How do I change datepicker format from DD MM to YYYY?

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);

How do I style a datepicker calendar?

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.


2 Answers

According to the documentation, a single M is "Month name short" and "yy" is "Four Digit Year."

dd-M-yy 
like image 200
Sampson Avatar answered Oct 30 '22 14:10

Sampson


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  
like image 27
Pekka Avatar answered Oct 30 '22 13:10

Pekka