我需要在jQuery UI datepicker中将月份名称从短名称更改为长名称。
我的属性是:
$.datepicker.regional['de'] = { prevText: '<zurück',nextText: 'vor>',monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],monthNamesShort: ['Jan','Feb','Mär','Apr','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],dayNamesMin: ['So',weekHeader: 'Wo',dateFormat: 'dd.mm.yy',firstDay: 1,changeMonth: true,changeYear: true,yearRange: "-0:+2",isRTL: false,showMonthAfterYear: false,minDate: 0 }; $.datepicker.setDefaults($.datepicker.regional['de']); var dates = $("#von,#bis").datepicker({ showOn: "button",buttonImage: "calendar.png",buttonImageOnly: true,buttonText: 'Datum w\u00E4hlen',onSelect: function (selectedDate) { var option = this.id == "#von" ? "minDate" : "maxDate",instance = $(this).data("datepicker"),date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat,selectedDate,instance.settings); dates.not(this).datepicker("option",option,date); } });
目前,日历仅在下拉列表中显示“Apr”而不是“April”等短月份名称。
也许我用一些代码来覆盖默认的长名字?
请帮忙。