everybody... I was wondering how I could format the a date in the datepicker 'd de MM de yy' in stead of 'dd/MM/yy'.
(suppose the date is 21/01/2011 (in spanish) .. so: $("#element").datepicker({ dateFormat:'d de MM de yy' });
It will output : 21 21e Enero 21e yy
The question is.. is there an escape character so I can format the date? Thanks, sorry for my English, hope you guys understand
You can escape any plain text characters:
$("#element").datepicker({ dateFormat:'d \\d\\e MM \\d\\e yy' });
You may also be able to escape plain text using single quotes:
$("#element").datepicker({ dateFormat:"d 'de' MM 'de' yy" });
You can define the datepicker on startup, then just use a class to attach it later. I've defined a datepicker like this:
$(".date-pick").datepicker($.extend({}, $.datepicker.regional["no"], {showStatus: true, defaultDate: +1, minDate: 1, maxDate: 365, dateFormat: "dd.mm.yy", showOn: "both", buttonImage: "../images/shop/calendar.png", buttonImageOnly: true}));
Should be explained in the options/documentation.
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