1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

fix bug: cant set correct default date for fullcalendar

This commit is contained in:
Peng DU 2016-07-18 10:37:54 +02:00
parent 70d623f65a
commit 9638b775fc

View File

@ -76,8 +76,8 @@ Application.Controllers.controller "CalendarController", ["$scope", "$state", "$
# set defaultView, because when we change slotEventOverlap
# ui-calendar will trigger rerender calendar
$scope.calendarConfig.defaultView = view.type
today = currentMachineEvent or moment().utc().startOf('day')
if today > view.start and today <= view.end and today != view.start
today = if currentMachineEvent then currentMachineEvent.start else moment().utc().startOf('day')
if today > view.start and today < view.end and today != view.start
$scope.calendarConfig.defaultDate = today
else
$scope.calendarConfig.defaultDate = view.start