mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 14:32:18 +00:00
Fix: Browser back
This commit is contained in:
@@ -152,28 +152,33 @@ export default {
|
||||
return res;
|
||||
});
|
||||
},
|
||||
sDate() {
|
||||
if (this.date instanceof luxon.DateTime)
|
||||
return this.date;
|
||||
return luxon.DateTime.fromJSDate(new Date(this.date)).setZone(this.timezone);
|
||||
},
|
||||
cDate: {
|
||||
get() {
|
||||
if (this.internalDate) {
|
||||
return this.internalDate.setLocale(this.locale);
|
||||
}
|
||||
return luxon.DateTime.fromJSDate(new Date(this.date)).setZone(this.timezone).setLocale(this.locale);
|
||||
const date = this.internalDate ? this.internalDate : this.sDate;
|
||||
return date.setLocale(this.locale);
|
||||
},
|
||||
set(value) {
|
||||
this.internalDate = value;
|
||||
this.$emit('update:date', value);
|
||||
}
|
||||
},
|
||||
sMode() {
|
||||
// choose default mode
|
||||
let mode = this.mode;
|
||||
if (mode)
|
||||
mode = mode.toLowerCase();
|
||||
if (!mode || !this.modes[mode])
|
||||
mode = Object.keys(this.modes).find(Boolean); // start with first entry as active mode
|
||||
return mode || '';
|
||||
},
|
||||
cMode: {
|
||||
get() {
|
||||
if (!this.internalView) {
|
||||
// choose default mode
|
||||
let mode = this.mode;
|
||||
if (!mode || !this.modes[mode])
|
||||
mode = Object.keys(this.modes).find(Boolean); // start with first entry as active mode
|
||||
return mode || '';
|
||||
}
|
||||
return this.internalView;
|
||||
return this.internalView ? this.internalView : this.sMode;
|
||||
},
|
||||
set(value) {
|
||||
this.internalView = value;
|
||||
@@ -181,6 +186,16 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sDate(n, o) {
|
||||
if (this.sDate.isValid && !this.sDate.hasSame(this.internalDate, 'day'))
|
||||
this.internalDate = this.sDate;
|
||||
},
|
||||
sMode() {
|
||||
if (this.sMode)
|
||||
this.internalView = this.sMode;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickPrev() {
|
||||
const evt = new Event('click:prev', {cancelable: true});
|
||||
|
||||
@@ -40,8 +40,6 @@ export default {
|
||||
collapseEmptyDays: false
|
||||
}
|
||||
},
|
||||
currentDay: this.propsViewData?.focus_date,
|
||||
calendarMode: this.propsViewData?.mode ?? DEFAULT_MODE_LVPLAN,
|
||||
studiensemester_kurzbz: null,
|
||||
studiensemester_start: null,
|
||||
studiensemester_ende: null,
|
||||
@@ -49,10 +47,16 @@ export default {
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
currentDay() {
|
||||
return this.propsViewData?.focus_date || luxon.DateTime.now().setZone(this.viewData.timezone).toISODate();
|
||||
},
|
||||
currentMode() {
|
||||
return this.propsViewData?.mode || DEFAULT_MODE_LVPLAN;
|
||||
},
|
||||
backgrounds() {
|
||||
let now = luxon.DateTime.now().setZone(this.viewData.timezone);
|
||||
|
||||
if (this.calendarMode == 'Month')
|
||||
if (this.currentMode == 'Month')
|
||||
return [
|
||||
{
|
||||
class: 'background-past',
|
||||
@@ -103,7 +107,7 @@ export default {
|
||||
},
|
||||
handleChangeDate(day) {
|
||||
const focus_date = day.toISODate();
|
||||
const mode = this.calendarMode[0].toUpperCase() + this.calendarMode.slice(1);
|
||||
const mode = this.currentMode;
|
||||
|
||||
this.$router.push({
|
||||
name: "LvPlan",
|
||||
@@ -113,8 +117,6 @@ export default {
|
||||
lv_id: this.propsViewData?.lv_id || null
|
||||
}
|
||||
})
|
||||
|
||||
this.currentDay = day;
|
||||
},
|
||||
handleChangeMode(newMode) {
|
||||
const mode = newMode[0].toUpperCase() + newMode.slice(1)
|
||||
@@ -130,8 +132,6 @@ export default {
|
||||
lv_id: this.propsViewData?.lv_id ?? null
|
||||
}
|
||||
});
|
||||
|
||||
this.calendarMode = mode;
|
||||
},
|
||||
updateRange(rangeInterval) {
|
||||
this.rangeInterval = rangeInterval;
|
||||
@@ -188,7 +188,7 @@ export default {
|
||||
:date="currentDay"
|
||||
:modes="modes"
|
||||
:mode-options="modeOptions"
|
||||
:mode="propsViewData.mode.toLowerCase()"
|
||||
:mode="currentMode"
|
||||
@update:date="handleChangeDate"
|
||||
@update:mode="handleChangeMode"
|
||||
@update:range="updateRange"
|
||||
|
||||
@@ -37,16 +37,20 @@ export default {
|
||||
week: {
|
||||
collapseEmptyDays: false
|
||||
}
|
||||
},
|
||||
currentDay: this.propsViewData?.focus_date,
|
||||
calendarMode: this.propsViewData?.mode ?? DEFAULT_MODE_RAUMINFO
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentDay() {
|
||||
return this.propsViewData?.focus_date || luxon.DateTime.now().setZone(this.viewData.timezone).toISODate();
|
||||
},
|
||||
currentMode() {
|
||||
return this.propsViewData?.mode || DEFAULT_MODE_RAUMINFO;
|
||||
},
|
||||
backgrounds() {
|
||||
let now = luxon.DateTime.now().setZone(this.viewData.timezone);
|
||||
|
||||
if (this.calendarMode == 'Month')
|
||||
if (this.currentMode == 'Month')
|
||||
return [
|
||||
{
|
||||
class: 'background-past',
|
||||
@@ -71,7 +75,7 @@ export default {
|
||||
},
|
||||
handleChangeDate(day) {
|
||||
const focus_date = day.toISODate();
|
||||
const mode = this.calendarMode[0].toUpperCase() + this.calendarMode.slice(1);
|
||||
const mode = this.currentMode;
|
||||
|
||||
this.$router.push({
|
||||
name: "RoomInformation",
|
||||
@@ -81,8 +85,6 @@ export default {
|
||||
ort_kurzbz: this.propsViewData.ort_kurzbz
|
||||
}
|
||||
})
|
||||
|
||||
this.currentDay = day;
|
||||
},
|
||||
handleChangeMode(newMode) {
|
||||
const mode = newMode[0].toUpperCase() + newMode.slice(1)
|
||||
@@ -98,8 +100,6 @@ export default {
|
||||
ort_kurzbz: this.propsViewData.ort_kurzbz
|
||||
}
|
||||
})
|
||||
|
||||
this.calendarMode = mode
|
||||
},
|
||||
updateRange(rangeInterval) {
|
||||
this.rangeInterval = rangeInterval;
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
:date="currentDay"
|
||||
:modes="modes"
|
||||
:mode-options="modeOptions"
|
||||
:mode="propsViewData.mode.toLowerCase()"
|
||||
:mode="currentMode"
|
||||
@update:date="handleChangeDate"
|
||||
@update:mode="handleChangeMode"
|
||||
@update:range="updateRange"
|
||||
|
||||
Reference in New Issue
Block a user