views:

355

answers:

2

i cant for the life of me figure out how to change the date from default mm/dd/yyyy to the european dd/mm/yyyy

the manual states to use:

$.datepicker.formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26));

so far i have:

$('#next_date').datepicker();

which shows the calendar fine but im not sure where the first line of code goes. this for example disables the calendar, nothing shows up, no js errors reported

$('#next_date').datepicker.formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26));
+1  A: 

edit: i think i gave you code not for the jquery-ui datepicker. anyway, try this:

$('#next_date').datepicker({ altFormat: 'yy-mm-dd' });
mkoryak
sorry, how would the yy-mm-dd get passed to the datepicker function? just this code doesnt do it
stef
thanks for your edit but unfortunately still no luck ...
stef
here we go$("#last_date").datepicker({ dateFormat: 'dd-M-yy' });
stef
A: 

$("#last_date").datepicker({ dateFormat: 'dd-M-yy' }); worked great thank you..

afzal