From f582e617f6fea0a543ba9e683b9637f9557bb997 Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 19 Jun 2025 11:55:01 +0200 Subject: affichage date visiteur correct --- public/js/calendar.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'public/js') diff --git a/public/js/calendar.js b/public/js/calendar.js index fb26e80..af9ffb4 100644 --- a/public/js/calendar.js +++ b/public/js/calendar.js @@ -52,15 +52,21 @@ document.addEventListener('DOMContentLoaded', function(){ return date; } - const formated_start = formatDate(info.event.start); - const formated_end = formatDate(info.event.allDay ? getEndMinusOneDay(info.event.end) : info.event.end, info.event.allDay); - + 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 end = formatDate(info.event.allDay ? getEndMinusOneDay(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 aside_content = `

` + info.event.title + `

` + info.event.extendedProps.description + `

-

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

-

Début: ` + formated_start + `

-

Fin: ` + formated_end + `

+

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

+

Début:
` + formated_start + `

+

Fin:
` + formated_end + `

`; aside.innerHTML = aside_content; -- cgit v1.2.3