mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixed a bug that caused calendars picker to not use the proper client-side localization files for non-gregorian calendars.
This commit is contained in:
@@ -128,20 +128,21 @@
|
||||
var dayNamesMin = FormatJsList(dateTimeFormatProvider.DayNamesMin.ToArray());
|
||||
var firstDay = Convert.ToInt32(dateTimeFormatProvider.FirstDay);
|
||||
<text>
|
||||
$.calendars.calendars.@(calendarName).prototype.regional['@HttpUtility.JavaScriptStringEncode(currentCulture.Name)'] = {
|
||||
monthNames: [@Html.Raw(monthNames)], // Names of months for drop-down and formatting
|
||||
monthNamesShort: [@Html.Raw(monthNamesShort)], // Short namese of months
|
||||
dayNames: [@Html.Raw(dayNames)], // Names of days
|
||||
dayNamesShort: [@Html.Raw(dayNamesShort)], // Short names of days
|
||||
dayNamesMin: [@Html.Raw(dayNamesMin)], // Column headings for days starting at Sunday
|
||||
dateFormat: '@HttpUtility.JavaScriptStringEncode(dateFormat)', // See format options on parseDate
|
||||
firstDay: @firstDay, // First day of the week
|
||||
isRTL: @(currentCulture.TextInfo.IsRightToLeft ? "true" : "false") // True if right-to-left language, false if left-to-right
|
||||
};
|
||||
</text>
|
||||
localizationName = '@HttpUtility.JavaScriptStringEncode(currentCulture.Name)';
|
||||
$.calendars.calendars.@(calendarName).prototype.regional[localizationName] = {
|
||||
monthNames: [@Html.Raw(monthNames)], // Names of months for drop-down and formatting
|
||||
monthNamesShort: [@Html.Raw(monthNamesShort)], // Short namese of months
|
||||
dayNames: [@Html.Raw(dayNames)], // Names of days
|
||||
dayNamesShort: [@Html.Raw(dayNamesShort)], // Short names of days
|
||||
dayNamesMin: [@Html.Raw(dayNamesMin)], // Column headings for days starting at Sunday
|
||||
dateFormat: '@HttpUtility.JavaScriptStringEncode(dateFormat)', // See format options on parseDate
|
||||
firstDay: @firstDay, // First day of the week
|
||||
isRTL: @(currentCulture.TextInfo.IsRightToLeft ? "true" : "false") // True if right-to-left language, false if left-to-right
|
||||
};
|
||||
</text>
|
||||
}
|
||||
|
||||
$.calendars.picker.regional['@HttpUtility.JavaScriptStringEncode(currentCulture.Name)'] = {
|
||||
$.calendars.picker.regional[localizationName] = {
|
||||
prevText: '@HttpUtility.JavaScriptStringEncode(T("Prev").Text)', // Display text for previous month link
|
||||
prevStatus: '@HttpUtility.JavaScriptStringEncode(T("Show the previous month").Text)', // Tooltip text for previous month link
|
||||
prevJumpText: '@HttpUtility.JavaScriptStringEncode(T("<<").Text)', // Display text for previous year link
|
||||
@@ -167,9 +168,9 @@
|
||||
isRTL: @(currentCulture.TextInfo.IsRightToLeft ? "true" : "false") // True if right-to-left language, false if left-to-right
|
||||
};
|
||||
|
||||
$.calendars.picker.setDefaults($.calendars.picker.regional['@HttpUtility.JavaScriptStringEncode(currentCulture.Name)']);
|
||||
$.calendars.picker.setDefaults($.calendars.picker.regional[localizationName]);
|
||||
$.calendars.picker.setDefaults({
|
||||
calendar: $.calendars.instance(calendarName, '@HttpUtility.JavaScriptStringEncode(currentCulture.Name)'),
|
||||
calendar: $.calendars.instance(calendarName, localizationName),
|
||||
dateFormat: dateFormat
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user