From f007bac3b9172711dc0fcca1306270ab99dbd8a4 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 24 Jun 2025 01:04:35 +0200 Subject: =?UTF-8?q?am=C3=A9lioration=20affichage,=20contr=C3=B4le=20des=20?= =?UTF-8?q?entr=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/calendar.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'public/js/calendar.js') diff --git a/public/js/calendar.js b/public/js/calendar.js index 2193272..a092632 100644 --- a/public/js/calendar.js +++ b/public/js/calendar.js @@ -62,19 +62,24 @@ document.addEventListener('DOMContentLoaded', function(){ const start = formatDate(info.event.start); const start_date = start.split('T')[0]; const start_hour = (info.event.allDay ? '' : '
à ' + start.split('T')[1]).replace(":", "h"); - const formated_start = 'le ' + start_date.split('-')[2] + '/' + start_date.split('-')[1] + '/' + start_date.split('-')[0] + start_hour; + const formated_start = start_date.split('-')[2] + '/' + start_date.split('-')[1] + '/' + start_date.split('-')[0] + start_hour; const end = formatDate(info.event.allDay ? minusOneDay(info.event.end) : info.event.end, info.event.allDay); const end_date = end.split('T')[0]; const end_hour = (info.event.allDay ? '' : '
à ' + end.split('T')[1]).replace(":", "h"); - const formated_end = 'le ' + end_date.split('-')[2] + '/' + end_date.split('-')[1] + '/' + end_date.split('-')[0] + end_hour; + const formated_end = end_date.split('-')[2] + '/' + end_date.split('-')[1] + '/' + end_date.split('-')[0] + end_hour; - const aside_content = `
-

` + info.event.title + `

-

` + info.event.extendedProps.description + `

-

Journée entière:
` + (checked ? 'oui' : 'non') + `

-

Début:
` + formated_start + `

-

Fin:
` + formated_end + `

+ let aside_content = `
+

` + info.event.title + `

+

` + info.event.extendedProps.description + `

`; + if(checked && (formated_start === formated_end)){ // affichage simplifié évènement d'un jour + aside_content = aside_content + `

le ` + formated_start + `

`; + } + else{ + aside_content = aside_content + `

du ` + formated_start + `

+

au ` + formated_end + `

+
`; + } aside.innerHTML = aside_content; calendar.updateSize(); -- cgit v1.2.3