Hello,
I’m using the “Full day” flag in the lightbox and this is ok.
Events are show properly in the Month, Week and Day views.
The problem comes with the Agenda View.
Here the event is show to be two days long, because the end_date is set to the 00:00 of the following day.
This is a problem because the agenda gives a wrong information the the user and can lead to unwanted behaviours and possibly huge damages to the customer using the software.
He/she can unserstand that the event ends tomorrow so there is tome to do something, while the event is ending today…
Please take a look to the attached pictures.
Trying to create an event from 00:00 to 23:55 of the same day, you don’t get a satisfying result as with the full day event.
Is there a way to have the agenda showing one day only for such kind of events?
Thank you.
Hi,
by default scheduler treats full-day events as multiday events. You can override the date template for the agenda view, in order to display full day events dates as a regular ones
scheduler.templates.agenda_time = function(start,end,ev){
if (scheduler.isOneDayEvent(ev) || //if single day or if full day
(end - start == 24*60*60*1000 && !(start.getHours() || end.getHours() || start.getMinutes() || end.getMinutes())))
return this.day_date(ev.start_date, ev.end_date, ev)+" "+this.event_date(start);
else
return scheduler.templates.day_date(start)+" – "+scheduler.templates.day_date(end);
};
Great!
It’s exactly what I was looking for.
I did a small improvement in order to avoid dales like ‘6 Jan 2015 00:00’
scheduler.templates.agenda_time = function(start,end,ev){
if (scheduler.isOneDayEvent(ev) || //if single day or if full day
(end - start == 24*60*60*1000 && !(start.getHours() || end.getHours() || start.getMinutes() || end.getMinutes()))){
if (this.event_date(start)!='00:00')
return this.day_date(ev.start_date, ev.end_date, ev)+" "+this.event_date(start);
else
return this.day_date(ev.start_date, ev.end_date, ev);
}
else
return scheduler.templates.day_date(start)+" – "+scheduler.templates.day_date(end);
};
This only shows ‘6 Jan 2015’ for a full day event.
Thank you.