forked from DGNum/metis
Add initial date selection via querystring
This commit is contained in:
parent
bc634a8c35
commit
8279d15c04
1 changed files with 3 additions and 1 deletions
|
@ -37,6 +37,7 @@
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const params = new URL(document.location).searchParams.getAll('c');
|
const params = new URL(document.location).searchParams.getAll('c');
|
||||||
|
const date = new Date(new URL(document.location).searchParams.get('d'));
|
||||||
|
|
||||||
const headers = mobile
|
const headers = mobile
|
||||||
? {
|
? {
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
|
|
||||||
let options = writable({
|
let options = writable({
|
||||||
initialView: mobile ? 'listWeek' : 'timeGridWeek',
|
initialView: mobile ? 'listWeek' : 'timeGridWeek',
|
||||||
|
initialDate: date.toString() === 'Invalid Date' ? now : date,
|
||||||
plugins: [
|
plugins: [
|
||||||
timeGridPlugin,
|
timeGridPlugin,
|
||||||
dayGridPlugin,
|
dayGridPlugin,
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
allDayContent: '',
|
allDayContent: '',
|
||||||
headerToolbar: headers,
|
headerToolbar: headers,
|
||||||
buttonText: { resourceTimelineDay: 'Salles' },
|
buttonText: { resourceTimelineDay: 'Salles' },
|
||||||
scrollTime: "08:00:00",
|
scrollTime: '08:00:00',
|
||||||
resourceGroupField: 'building',
|
resourceGroupField: 'building',
|
||||||
resourceAreaWidth: '27%',
|
resourceAreaWidth: '27%',
|
||||||
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
|
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
|
||||||
|
|
Loading…
Reference in a new issue