BugFix agendaDay View
This commit is contained in:
parent
721df5833d
commit
684bb22a38
1 changed files with 34 additions and 34 deletions
|
@ -889,44 +889,44 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
||||||
$calendar.fullCalendar('renderEvent', unavailablePeriod, false);
|
$calendar.fullCalendar('renderEvent', unavailablePeriod, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Extra working plan day.
|
|
||||||
var selectedDay = $calendar.fullCalendar('getView').intervalStart.clone();
|
|
||||||
selectedDay.locale('en');
|
|
||||||
if (extraWorkingPlan != null && selectedDay.format() in extraWorkingPlan) {
|
|
||||||
workingPlan[selectedDay.format('dddd').toLowerCase()] = extraWorkingPlan[selectedDay.format('YYYY-MM-DD')];
|
|
||||||
|
|
||||||
var start_extra = selectedDay.format('YYYY-MM-DD') + ' ' + extraWorkingPlan[selectedDay.format('YYYY-MM-DD')].start;
|
|
||||||
var end_extra = selectedDay.format('YYYY-MM-DD') + ' ' + extraWorkingPlan[selectedDay.format('YYYY-MM-DD')].end;
|
|
||||||
|
|
||||||
var extraPeriod = {
|
|
||||||
title: EALang.extra_period,
|
|
||||||
start: moment(start_extra, 'YYYY-MM-DD HH:mm', true),
|
|
||||||
end: moment(end_extra, 'YYYY-MM-DD HH:mm', true).add(1, 'day'),
|
|
||||||
allDay: true,
|
|
||||||
color: '#879DB4',
|
|
||||||
editable: false,
|
|
||||||
className: 'fc-extra fc-custom',
|
|
||||||
data: provider
|
|
||||||
};
|
|
||||||
|
|
||||||
$calendar.fullCalendar('renderEvent', extraPeriod, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Non-working day.
|
// Non-working day.
|
||||||
if (workingPlan[selectedDayName] == null) {
|
if (workingPlan[selectedDayName] == null) {
|
||||||
unavailablePeriod = {
|
// Extra working plan day.
|
||||||
title: EALang.not_working,
|
var selectedDay = $calendar.fullCalendar('getView').intervalStart.clone();
|
||||||
start: $calendar.fullCalendar('getView').intervalStart.clone(),
|
selectedDay.locale('en');
|
||||||
end: $calendar.fullCalendar('getView').intervalEnd.clone(),
|
if (extraWorkingPlan != null && selectedDay.format() in extraWorkingPlan) {
|
||||||
allDay: false,
|
workingPlan[selectedDay.format('dddd').toLowerCase()] = extraWorkingPlan[selectedDay.format('YYYY-MM-DD')];
|
||||||
color: '#BEBEBE',
|
|
||||||
editable: false,
|
|
||||||
className: 'fc-unavailable'
|
|
||||||
};
|
|
||||||
|
|
||||||
$calendar.fullCalendar('renderEvent', unavailablePeriod, false);
|
var start_extra = selectedDay.format('YYYY-MM-DD') + ' ' + extraWorkingPlan[selectedDay.format('YYYY-MM-DD')].start;
|
||||||
|
var end_extra = selectedDay.format('YYYY-MM-DD') + ' ' + extraWorkingPlan[selectedDay.format('YYYY-MM-DD')].end;
|
||||||
|
|
||||||
return; // Go to next loop.
|
var extraPeriod = {
|
||||||
|
title: EALang.extra_period,
|
||||||
|
start: moment(start_extra, 'YYYY-MM-DD HH:mm', true),
|
||||||
|
end: moment(end_extra, 'YYYY-MM-DD HH:mm', true).add(1, 'day'),
|
||||||
|
allDay: true,
|
||||||
|
color: '#879DB4',
|
||||||
|
editable: false,
|
||||||
|
className: 'fc-extra fc-custom',
|
||||||
|
data: provider
|
||||||
|
};
|
||||||
|
|
||||||
|
$calendar.fullCalendar('renderEvent', extraPeriod, false);
|
||||||
|
} else {
|
||||||
|
unavailablePeriod = {
|
||||||
|
title: EALang.not_working,
|
||||||
|
start: $calendar.fullCalendar('getView').intervalStart.clone(),
|
||||||
|
end: $calendar.fullCalendar('getView').intervalEnd.clone(),
|
||||||
|
allDay: false,
|
||||||
|
color: '#BEBEBE',
|
||||||
|
editable: false,
|
||||||
|
className: 'fc-unavailable'
|
||||||
|
};
|
||||||
|
|
||||||
|
$calendar.fullCalendar('renderEvent', unavailablePeriod, false);
|
||||||
|
|
||||||
|
return; // Go to next loop.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add unavailable period before work starts.
|
// Add unavailable period before work starts.
|
||||||
|
|
Loading…
Reference in a new issue