Add initial date selection via querystring

This commit is contained in:
Tom Hubrecht 2022-07-26 15:20:01 +02:00
parent bc634a8c35
commit 8279d15c04

View file

@ -37,6 +37,7 @@
})();
const params = new URL(document.location).searchParams.getAll('c');
const date = new Date(new URL(document.location).searchParams.get('d'));
const headers = mobile
? {
@ -54,6 +55,7 @@
let options = writable({
initialView: mobile ? 'listWeek' : 'timeGridWeek',
initialDate: date.toString() === 'Invalid Date' ? now : date,
plugins: [
timeGridPlugin,
dayGridPlugin,
@ -67,7 +69,7 @@
allDayContent: '',
headerToolbar: headers,
buttonText: { resourceTimelineDay: 'Salles' },
scrollTime: "08:00:00",
scrollTime: '08:00:00',
resourceGroupField: 'building',
resourceAreaWidth: '27%',
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>