JQuery DatePicker -> dateformat, how to output dayNamesMin instead of dayNamesShort?
Hi there i am trying to output the selection of a date. Using the D option gives me days like 'Thu' or 'Mon'. When i try to localize this format using the 'nl' localisation, the the output is again nicely in 3 letters such as 'don' or 'maa'
But for parsing the date (using Javascript) into the Dutch language i need to have the 'd开发者_C百科o' and 'ma' so the dayNamesMin. Is there a way that i can configure JQuery datepicker the correct localized day?
Try using the altFormat
option of the jQuery UI date picker, this should allow you to do what you want.
Strange enough, you cannot specify a date format with dayNamesMin
. You can, however, specify dayNamesShort
and dayNames
in your options. So, for example, you could copy dayNamesMin
to dayNamesShort
and use D
in your date format.
var minDays = $('#datepicker').datepicker('option', 'dayNamesMin');
$('#datepicker').datepicker('option', 'dayNamesShort', minDays);
See this in action: http://jsfiddle.net/william/bBA9F/3/.
Note that, for some reason, the #datepicker
div wouldn't be hidden after the two statements above, hence the last statement in the jsfiddle.
精彩评论