From df690a62893468f171a95c18709a28e288cdd764 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 28 Jul 2022 18:43:40 +0200 Subject: [PATCH 01/37] Better print quality --- src/App.svelte | 22 ++++++++++++++++++++++ src/Help.svelte | 2 +- src/Share.svelte | 7 ++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 78eda8d..626cb72 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -15,6 +15,7 @@ import Help from './Help.svelte'; import Share from './Share.svelte'; import Spinner from './Spinner.svelte'; + import { Icon } from 'sveltestrap'; import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap-icons/font/bootstrap-icons.css'; @@ -178,6 +179,14 @@

Calendrier de la vie étudiante à l'ENS

+ window.print()} + > + + + @@ -189,6 +198,13 @@
diff --git a/src/Help.svelte b/src/Help.svelte index 912dfbe..7afe4c6 100644 --- a/src/Help.svelte +++ b/src/Help.svelte @@ -5,7 +5,7 @@ const toggle = () => (isOpen = !isOpen); - + diff --git a/src/Share.svelte b/src/Share.svelte index db8dd30..c6f2b7e 100644 --- a/src/Share.svelte +++ b/src/Share.svelte @@ -69,7 +69,12 @@ - - {#if event.allDay} + {#if event.extendedProps.simAllDay} + + {dateFormat(event.start)} ({timeFormat(event.extendedProps.realStart)}) - {dateFormat(event.end)} ({timeFormat(event.extendedProps.realEnd)}) + {:else if event.allDay} {dateFormat(event.start)} - {dateFormat(event.end)} {:else} diff --git a/src/calendar.js b/src/calendar.js index e3c0b36..ca9d2d6 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -132,13 +132,29 @@ function fcEventFromjCalEvent(cal) { return function (evt) { const start = new Date(evt.dtstart) const end = new Date(evt.dtend) + + const duration = end - start // in ms + const dayMs = 24 * 3600 * 1000 + const fcEvent = { title: `${cal.short_name ?? cal.name} : ${evt.summary}`, - start: evt.dtstart, - end: evt.dtend, + start: start, + end: end, color: cal.color, textColor: invertColor(cal.color), - duration: end - start // in ms + duration: duration + } + + if (duration > dayMs - 1) { + fcEvent.allDay = true + fcEvent.simAllDay = true + + fcEvent.realStart = new Date(start) + fcEvent.realEnd = new Date(end) + + fcEvent.start.setUTCHours(0, 0, 0) + fcEvent.end.setUTCHours(23, 59, 59) + fcEvent.duration = end - start // Update the duration } fcEvent.calendar = cal.name -- 2.46.1 From 32d9b4d60c601ef23df4444320aabfb94efb12a0 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 25 Oct 2022 10:38:09 +0200 Subject: [PATCH 35/37] Fix display or real allDay events --- src/calendar.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calendar.js b/src/calendar.js index ca9d2d6..c8ef67a 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -133,27 +133,29 @@ function fcEventFromjCalEvent(cal) { const start = new Date(evt.dtstart) const end = new Date(evt.dtend) + const allDay = !evt.dtstart.endsWith('Z') + const duration = end - start // in ms const dayMs = 24 * 3600 * 1000 const fcEvent = { title: `${cal.short_name ?? cal.name} : ${evt.summary}`, - start: start, - end: end, + start: evt.dtstart, + end: evt.dtend, color: cal.color, textColor: invertColor(cal.color), duration: duration } - if (duration > dayMs - 1) { + if (!allDay && (duration > dayMs - 1)) { fcEvent.allDay = true fcEvent.simAllDay = true fcEvent.realStart = new Date(start) fcEvent.realEnd = new Date(end) - fcEvent.start.setUTCHours(0, 0, 0) - fcEvent.end.setUTCHours(23, 59, 59) + fcEvent.start = start.setUTCHours(0, 0, 0) + fcEvent.end = end.setUTCHours(23, 59, 59) fcEvent.duration = end - start // Update the duration } -- 2.46.1 From 7c5df4e7904eb6c55a6578d4b5c47cb87c3a812f Mon Sep 17 00:00:00 2001 From: sinavir Date: Sun, 23 Jul 2023 13:27:12 +0200 Subject: [PATCH 36/37] =?UTF-8?q?Add=20rentr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/calendars.json | 50 +++++++++++++++++++++++++++++++++++++++++++-- data/locations.json | 4 +++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/data/calendars.json b/data/calendars.json index 5986545..0ef8aa9 100644 --- a/data/calendars.json +++ b/data/calendars.json @@ -1,6 +1,15 @@ { "tree": { + "Rentrée": { + "Amphis de rentrée": {}, + "Départements": {}, + "Visites de bibliothèque": {}, + "Masters": {}, + "Étudiants internationaux": {}, + "Conférences de recherche": {} + }, "COF": { + "Rentrée du COF": {}, "Évènements (COF)": {}, "Assemblées Générales (COF)": {}, "BdA": { @@ -24,7 +33,10 @@ "Ulmity": {}, "Club Inutile ☔": {} }, - "BDS": {}, + "BDS": { + "Évènements (BDS)": {}, + "Rentrée du BDS": {} + }, "Clubs BDS": { "Créneaux encadrés": {} }, @@ -123,7 +135,7 @@ "short_name": "Banda" }, "dSYCtdC6bgyWpKyt": { - "name": "BDS" + "name": "Évènements (BDS)" }, "goXLq2dQ8LgFAjkM": { "name": "Club Bouffe" @@ -144,6 +156,40 @@ }, "AYNpoC674yAjEmRy": { "name": "L'Hômonerie" + }, + "TcwNdrs6iyBRxFzk": { + "name": "Divers" + }, + "G5ZRyTkMifXC2iHj": { + "name": "Amphis de rentrée", + "short_name": "Amphis" + }, + "dJofECeczaGgNiKs": { + "name": "Rentrée du BDS", + "short_name": "BDS" + }, + "7Rwd8JERwBsso7XG": { + "name": "Rentrée du COF", + "short_name": "COF" + }, + "tiMsNcncqBxR4nL2": { + "name": "Départements", + "short_name": "Dpt" + }, + "RpP773D6e2ReLfcY": { + "name": "Visites de bibliothèque", + "short_name": "Bibli" + }, + "YRZ4A8imEEf8jnDE": { + "name": "Masters" + }, + "8EDHX6kiPYcSrXXL": { + "name": "Étudiants internationaux", + "short_name": "Internationaux" + }, + "TWgNxdri7zQSoiRf": { + "name": "Conférences de recherche", + "short_name": "Conf" } } } diff --git a/data/locations.json b/data/locations.json index 5e705d8..a90d540 100644 --- a/data/locations.json +++ b/data/locations.json @@ -1,10 +1,12 @@ { "nameMap": { "Amphi Jourdan": "Amphithéâtre Jourdan", + "Cour aux Ernest": "Cour aux Ernests", "R2-21 (Jourdan)": "R2-21", "Salle Jean Ibanes (Jourdan, R1-07)": "Salle Jean Ibanes (R1-07)", "Salle Madeleine Rebérioux (Jourdan, R2-02)": "Salle Madeleine Rebérioux (R2-02)", - "Salle Marcel Roncayolo (Jourdan, R2-05)": "Salle Marcel Roncayolo (R2-05)" + "Salle Marcel Roncayolo (Jourdan, R2-05)": "Salle Marcel Roncayolo (R2-05)", + "Cour des bibliothèques": "Cour du NIR" }, "rooms": { -- 2.46.1 From 85570af7afa4b618ee59b194191d9198b88e9627 Mon Sep 17 00:00:00 2001 From: sinavir Date: Wed, 20 Sep 2023 15:37:55 +0200 Subject: [PATCH 37/37] Add arts-pla' --- data/calendars.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/calendars.json b/data/calendars.json index 0ef8aa9..d4847ea 100644 --- a/data/calendars.json +++ b/data/calendars.json @@ -31,6 +31,7 @@ "BandarrêtdurgENS": {}, "L'Hômonerie": {}, "Ulmity": {}, + "Arts pla'": {}, "Club Inutile ☔": {} }, "BDS": { @@ -190,6 +191,10 @@ "TWgNxdri7zQSoiRf": { "name": "Conférences de recherche", "short_name": "Conf" + }, + "MJf2wnQafbLc2arS": { + "name": "Arts pla'", + "color": "#ffb969" } } } -- 2.46.1