Skip to content

Commit 17590e4

Browse files
author
Ronald Richardson
committed
revert: undo debug/date-fix attempts, restore to clean state
1 parent 78a9382 commit 17590e4

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

addon/routes/operations/scheduler/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,9 @@ export default class OperationsSchedulerIndexRoute extends Route {
5151
// so we do not need to set them explicitly here.
5252
controller.set('drivers', model.drivers.toArray());
5353

54-
// Initialise viewDate to the current moment so the calendar opens on
55-
// today. The @date arg is only used for the initial render — subsequent
56-
// navigation is handled imperatively via calendar.setOption('date', ...)
57-
// in the controller's goToPrev / goToNext / goToToday actions.
58-
// We do NOT re-apply @date on every re-render (it is excluded from the
59-
// did-update watch list) to prevent stale dates from overwriting the
60-
// user's current navigation position when events/resources reload.
54+
// Initialise viewDate to the current UTC instant.
55+
// @event-calendar/core applies timezoneOffsetMins internally so the
56+
// calendar opens on the correct company-local day automatically.
6157
controller.set('viewDate', new Date());
6258

6359
// Open SocketCluster subscriptions for real-time calendar updates.

addon/templates/operations/scheduler/index.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,21 @@
138138
>
139139
<EventCalendar
140140
@view={{this.currentCalendarView}}
141+
@date={{this.viewDate}}
141142
@events={{this.allCalendarEvents}}
142143
@resources={{this.calendarResources}}
144+
@editable={{true}}
145+
@slotMinTime={{this.calendarSlotMinTime}}
146+
@slotMaxTime={{this.calendarSlotMaxTime}}
147+
@slotWidth={{80}}
148+
@height="100%"
149+
@headerToolbar={{this.calendarHeaderToolbar}}
150+
@resourceLabelContent={{this.renderResourceLabel}}
151+
@eventContent={{this.renderEventContent}}
152+
@onEventDrop={{this.rescheduleEventFromDrag}}
153+
@onEventClick={{this.viewOrderAsEvent}}
143154
@onCalendarReady={{this.setCalendarApi}}
155+
@options={{this.calendarOptions}}
144156
/>
145157
</div>
146158
</div>

0 commit comments

Comments
 (0)