I have a jQuery UI datepicker and I am looking to localize the date returned and then format it to remove the leading zeros.
It seems I can do either one or the other. Is there a way to both localize and format it?
My example code:
// myDate = 01/25/2010
// myLanguage = ""; //for US english, but could be any language
$('#mytxtbox').datepicker($.datepicker.regional['<%= mylanguage %>']);
$('#mytxtbox').datepicker({ dateFormat: 'm/d/yy' });
var dateToSet = $.datepicker.parseDate('m/d/yy', '<%= myDate %>');
$('#mytxtbox').datepicker("setDate", dateToSet);
in the above example the date that gets displayed in my text box is "01/25/2010". If I comment out the line that sets the region, the formatting works (i.e. 1/25/2010). It seems to me that the localization is overwriting my "dateFormat"? Is it possible to do both?
Please note, I have included all appropriate region files