diff options
Diffstat (limited to 'public/js/calendar.js')
-rw-r--r-- | public/js/calendar.js | 21 |
1 files changed, 13 insertions, 8 deletions
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(){ | |||
62 | const start = formatDate(info.event.start); | 62 | const start = formatDate(info.event.start); |
63 | const start_date = start.split('T')[0]; | 63 | const start_date = start.split('T')[0]; |
64 | const start_hour = (info.event.allDay ? '' : '<br>à ' + start.split('T')[1]).replace(":", "h"); | 64 | const start_hour = (info.event.allDay ? '' : '<br>à ' + start.split('T')[1]).replace(":", "h"); |
65 | const formated_start = 'le ' + start_date.split('-')[2] + '/' + start_date.split('-')[1] + '/' + start_date.split('-')[0] + start_hour; | 65 | const formated_start = start_date.split('-')[2] + '/' + start_date.split('-')[1] + '/' + start_date.split('-')[0] + start_hour; |
66 | const end = formatDate(info.event.allDay ? minusOneDay(info.event.end) : info.event.end, info.event.allDay); | 66 | const end = formatDate(info.event.allDay ? minusOneDay(info.event.end) : info.event.end, info.event.allDay); |
67 | const end_date = end.split('T')[0]; | 67 | const end_date = end.split('T')[0]; |
68 | const end_hour = (info.event.allDay ? '' : '<br>à ' + end.split('T')[1]).replace(":", "h"); | 68 | const end_hour = (info.event.allDay ? '' : '<br>à ' + end.split('T')[1]).replace(":", "h"); |
69 | const formated_end = 'le ' + end_date.split('-')[2] + '/' + end_date.split('-')[1] + '/' + end_date.split('-')[0] + end_hour; | 69 | const formated_end = end_date.split('-')[2] + '/' + end_date.split('-')[1] + '/' + end_date.split('-')[0] + end_hour; |
70 | 70 | ||
71 | const aside_content = `<div class="event" style="border-color: ` + info.event.backgroundColor +`;"> | 71 | let aside_content = `<div class="event" style="border-color: ` + info.event.backgroundColor +`;"> |
72 | <h3>` + info.event.title + `</h3> | 72 | <h3>` + info.event.title + `</h3> |
73 | <p><i>` + info.event.extendedProps.description + `</i></p> | 73 | <p><i>` + info.event.extendedProps.description + `</i></p>`; |
74 | <p>Journée entière: <br>` + (checked ? 'oui' : 'non') + `</p> | 74 | if(checked && (formated_start === formated_end)){ // affichage simplifié évènement d'un jour |
75 | <p>Début: <br>` + formated_start + `</p> | 75 | aside_content = aside_content + `<p>le ` + formated_start + `</p> |
76 | <p>Fin: <br> ` + formated_end + `</p> | ||
77 | </div>`; | 76 | </div>`; |
77 | } | ||
78 | else{ | ||
79 | aside_content = aside_content + `<p>du ` + formated_start + `</p> | ||
80 | <p>au ` + formated_end + `</p> | ||
81 | </div>`; | ||
82 | } | ||
78 | 83 | ||
79 | aside.innerHTML = aside_content; | 84 | aside.innerHTML = aside_content; |
80 | calendar.updateSize(); | 85 | calendar.updateSize(); |