BugFix agendaDay View

This commit is contained in:
Andrea 2018-04-12 16:46:45 +02:00
parent 721df5833d
commit 684bb22a38

View file

@ -889,6 +889,8 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
$calendar.fullCalendar('renderEvent', unavailablePeriod, false); $calendar.fullCalendar('renderEvent', unavailablePeriod, false);
}); });
// Non-working day.
if (workingPlan[selectedDayName] == null) {
// Extra working plan day. // Extra working plan day.
var selectedDay = $calendar.fullCalendar('getView').intervalStart.clone(); var selectedDay = $calendar.fullCalendar('getView').intervalStart.clone();
selectedDay.locale('en'); selectedDay.locale('en');
@ -910,10 +912,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
}; };
$calendar.fullCalendar('renderEvent', extraPeriod, false); $calendar.fullCalendar('renderEvent', extraPeriod, false);
} } else {
// Non-working day.
if (workingPlan[selectedDayName] == null) {
unavailablePeriod = { unavailablePeriod = {
title: EALang.not_working, title: EALang.not_working,
start: $calendar.fullCalendar('getView').intervalStart.clone(), start: $calendar.fullCalendar('getView').intervalStart.clone(),
@ -928,6 +927,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
return; // Go to next loop. return; // Go to next loop.
} }
}
// Add unavailable period before work starts. // Add unavailable period before work starts.
var calendarDateStart = moment($calendar.fullCalendar('getView').start.format('YYYY-MM-DD') + ' 00:00:00'); var calendarDateStart = moment($calendar.fullCalendar('getView').start.format('YYYY-MM-DD') + ' 00:00:00');