Corrected working plan parsing for foreign languages (#461).

This commit is contained in:
alext 2018-04-09 13:50:00 +02:00
parent 271652c2b7
commit 7ee9f24f5a

View file

@ -789,6 +789,16 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
$calendar.fullCalendar('removeEvents');
$calendar.fullCalendar('addEventSource', calendarEvents);
var weekDays = [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday'
];
// :: ADD PROVIDER'S UNAVAILABLE TIME PERIODS
var calendarView = $calendar.fullCalendar('getView').name;
@ -800,7 +810,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
switch (calendarView) {
case 'agendaDay':
var selectedDayName = $calendar.fullCalendar('getView').start.format('dddd').toLowerCase();
var selectedDayName = weekDays[$calendar.fullCalendar('getView').start.format('d')];
// Add custom unavailable periods.
$.each(response.unavailables, function (index, unavailable) {