summaryrefslogtreecommitdiff
path: root/public/js/calendar.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/calendar.js')
-rw-r--r--public/js/calendar.js29
1 files changed, 17 insertions, 12 deletions
diff --git a/public/js/calendar.js b/public/js/calendar.js
index 2193272..7450a91 100644
--- a/public/js/calendar.js
+++ b/public/js/calendar.js
@@ -12,8 +12,8 @@ document.addEventListener('DOMContentLoaded', function(){
12 headerToolbar:{ 12 headerToolbar:{
13 left: 'prev,next today', 13 left: 'prev,next today',
14 center: 'title', 14 center: 'title',
15 right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' 15 //right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
16 //right: 'dayGridMonth,timeGridWeek' 16 right: 'dayGridMonth,timeGridWeek,listWeek'
17 }, 17 },
18 slotMinWidth: 70, 18 slotMinWidth: 70,
19 defaultAllDay: false, 19 defaultAllDay: false,
@@ -62,20 +62,25 @@ 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>`;
78 77 }
78 else{
79 aside_content = aside_content + `<p>du ` + formated_start + `</p>
80 <p>au ` + formated_end + `</p>
81 </div>`;
82 }
83
79 aside.innerHTML = aside_content; 84 aside.innerHTML = aside_content;
80 calendar.updateSize(); 85 calendar.updateSize();
81 }, 86 },
@@ -94,7 +99,7 @@ document.addEventListener('DOMContentLoaded', function(){
94 } 99 }
95 100
96 document.addEventListener('keydown', function(event){ 101 document.addEventListener('keydown', function(event){
97 if(event.key === 'Escape') { 102 if(event.key === 'Escape'){
98 hideModal(); 103 hideModal();
99 } 104 }
100 }); 105 });