views:

230

answers:

2

I'd like to change the Default altFormat, but I can't seem to get it to work.

$("#myFav").datepicker({ dateFormat: 'yy-mm-dd' });
$("#myFav").datepicker('option', 'dateFormat', 'yy-mm-dd');

I thought altFormat would work just the same?

+1  A: 

Have you tried what the documentation says:

$('.selector').datepicker({ altFormat: 'yy-mm-dd' });

or

$('.selector').datepicker('option', 'altFormat', 'yy-mm-dd');

For both the dateFormat and the altFormat:

$('.selector').datepicker({ dateFormat: 'yy-mm-dd', altFormat: 'yy-mm-dd' });
kgiannakakis
A: 

This changes the dateformat in my application:

$("#startdate").datepicker({dateFormat: 'dd-mm-yy'});
jao