made datepicker honor locale's week start day
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
var useMarkDown = userConfig.UseMarkDownOnSavedNotes;
|
||||
var useThreeDecimals = userConfig.UseThreeDecimalGasCost;
|
||||
var shortDatePattern = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
|
||||
var firstDayOfWeek = (int)System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
|
||||
var numberFormat = System.Globalization.CultureInfo.CurrentCulture.NumberFormat;
|
||||
var userLanguage = userConfig.UserLanguage;
|
||||
shortDatePattern = shortDatePattern.ToLower();
|
||||
@@ -58,7 +59,8 @@
|
||||
useMarkDown: "@useMarkDown" == "True",
|
||||
currencySymbol: decodeHTMLEntities("@numberFormat.CurrencySymbol"),
|
||||
useThreeDecimals: "@useThreeDecimals" == "True",
|
||||
useMPG: "@useMPG" == "True"
|
||||
useMPG: "@useMPG" == "True",
|
||||
firstDayOfWeek: @firstDayOfWeek
|
||||
}
|
||||
}
|
||||
function getShortDatePattern() {
|
||||
|
||||
@@ -149,6 +149,7 @@ function initCalendar() {
|
||||
startDate: "+0d",
|
||||
format: getShortDatePattern().pattern,
|
||||
todayHighlight: true,
|
||||
weekStart: getGlobalConfig().firstDayOfWeek,
|
||||
beforeShowDay: function (date) {
|
||||
var reminderDateIndex = groupedDates.findIndex(x => (x.date == date.getTime() || x.date == (date.getTime() - date.getTimezoneOffset() * 60000))); //take into account server timezone offset
|
||||
if (reminderDateIndex > -1) {
|
||||
|
||||
@@ -129,13 +129,15 @@ function initDatePicker(input, futureOnly) {
|
||||
input.datepicker({
|
||||
startDate: "+0d",
|
||||
format: getShortDatePattern().pattern,
|
||||
autoclose: true
|
||||
autoclose: true,
|
||||
weekStart: getGlobalConfig().firstDayOfWeek
|
||||
});
|
||||
} else {
|
||||
input.datepicker({
|
||||
endDate: "+0d",
|
||||
format: getShortDatePattern().pattern,
|
||||
autoclose: true
|
||||
autoclose: true,
|
||||
weekStart: getGlobalConfig().firstDayOfWeek
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user