mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 16:44:28 +00:00
fix(Calendar Date Issues):fixes a variety of user_locale calendar bugs
This commit is contained in:
@@ -89,7 +89,12 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"$p.user_locale.value"(newUserLocale){
|
||||
// reset the calculation of the calendarWeek when changing user_locale
|
||||
this.focusDate._clean();
|
||||
this.focusDate.setLocale(newUserLocale);
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
'select:day',
|
||||
@@ -201,6 +206,7 @@ export default {
|
||||
this.mode = allowedInitialModes[allowedInitialModes.indexOf(this.initialMode)] || allowedInitialModes.pop();
|
||||
this.date.set(new Date(this.initialDate));
|
||||
this.focusDate.set(this.date);
|
||||
this.focusDate.setLocale(this.$p.user_locale.value);
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs.container) {
|
||||
|
||||
@@ -38,6 +38,7 @@ export default {
|
||||
},
|
||||
weeks() {
|
||||
let firstDayOfMonth = new CalendarDate(this.year, this.month, 1);
|
||||
firstDayOfMonth.setLocale(this.$p.user_locale.value);
|
||||
let startDay = firstDayOfMonth.firstDayOfCalendarMonth;
|
||||
let endDay = firstDayOfMonth.lastDayOfCalendarMonth;
|
||||
|
||||
@@ -47,7 +48,8 @@ export default {
|
||||
week.days.push(new Date(startDay));
|
||||
|
||||
if (week.days.length == 7) {
|
||||
let d = new CalendarDate(week.days[res.length ? 0 : 6]);
|
||||
let d = new CalendarDate(week.days[5]);
|
||||
d.setLocale(this.$p.user_locale.value);
|
||||
week.no = d.w;
|
||||
week.y = d.y;
|
||||
res.push(week);
|
||||
|
||||
@@ -71,6 +71,7 @@ export default {
|
||||
days() {
|
||||
|
||||
let tmpDate = new CalendarDate(this.year,1,1); // NOTE(chris): somewhere in the middle of the year
|
||||
tmpDate.setLocale(this.$p.user_locale.value);
|
||||
tmpDate.w = this.week;
|
||||
let startDay = tmpDate.firstDayOfWeek;
|
||||
let result = [];
|
||||
|
||||
Reference in New Issue
Block a user