我正在使用JQuery Datepicker。当我查看调试器时,我可以看到我的代码通过本地化文件,然后当我将鼠标悬停在区域上时,我在列表中看不到它,我看到的只有en,en-us。 但是,即使日历显示为英文(应该是fr-CA),当我在日历上选择日期时,它会用法语发布。为什么法语模式仅在所选日期起作用。
希望我已正确发布。
$(
function () {
$('[id^="ctl00_PageContentPlaceHolder_DT"]:not([readonly]),[id^="ctl00_PageContentPlaceHolder_UN_EffectiveDate"]:not([readonly])').each(
function () {
var oldValue = $(this).val();
$(this).datepicker({
changeMonth: true,
changeYear: true,
yearRange: "1970:2060",
dateFormat: "d M yy",
defaultDate: "1 jan 2017",//FiscalYearStart, //"1 Jan 2017",
beforeShow: function (input, inst) {
setTimeout(function () {
inst.dpDiv.css({
top: $(".datepicker").offset().top + 35,
left: $(".datepicker").offset().left
});
}, 0)
},
onClose: function () {
$(this).focus();
}
});
$(this).val(oldValue);
});
// Set the language of the datepicker
var lang = (gLanguage == "E") ? "" : "fr-CA";
var test = lang
$.datepicker.setDefaults($.datepicker.regional[lang]);
var FiscalYearStart = $('input[id$=FiscalYearStart]').val();
});
/* Canadian-French initialisation for the jQuery UI date picker plugin. */
(function (factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define(["../widgets/datepicker"], factory);
} else {
// Browser globals
factory(jQuery.datepicker);
}
}
(function (datepicker) {
datepicker.regional["fr-CA"] = {
closeText: "Fermer",
prevText: "Précédent",
nextText: "Suivant",
currentText: "Aujourd'hui",
monthNames: ["janvier", "février", "mars", "avril", "mai", "juin",
"juillet", "août", "septembre", "octobre", "novembre", "décembre"],
monthNamesShort: ["jan", "fév", "mars", "avr", "mai", "juin",
"juil", "août", "sep", "oct", "nov", "déc"],
dayNames: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
dayNamesShort: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
dayNamesMin: ["D", "L", "M", "M", "J", "V", "S"],
weekHeader: "Sem.",
dateFormat: "yy-mm-dd",
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
datepicker.setDefaults(datepicker.regional["fr-CA"]);
return datepicker.regional["fr-CA"];
}));