@sprucelabs/spruce-calendar-components 28.2.36 → 28.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
32
32
  private loadEventInterval?;
33
33
  private shouldIgnoreNextDeselectEvent;
34
34
  private lastStartDate?;
35
+ private locale;
35
36
  constructor(options: ViewControllerOptions);
36
37
  getScope: () => ScopeFlag[];
37
38
  private createToolBeltStates;
@@ -48,7 +49,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
48
49
  getToolBeltStateMachine(): CalendarToolBeltStateMachine<import("../types/calendar.types").CalendarToolBeltContext>;
49
50
  getToolBeltStateId(): string | undefined;
50
51
  private CalendarVc;
51
- private handleChangeStartDate;
52
+ protected handleChangeStartDate(): Promise<void>;
52
53
  private makeDateSelectMatchSelectedDateFromCalendar;
53
54
  private setSelectedDateInDateSelectVc;
54
55
  private getStartDate;
@@ -76,7 +77,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
76
77
  private loadPeople;
77
78
  private loadScope;
78
79
  protected syncPeopleOnCalendar(): void;
79
- private syncOffsetWithLocale;
80
+ protected syncOffsetWithLocale(): void;
80
81
  protected loadEvents(options?: LoadEventOptions): Promise<void>;
81
82
  private _loadEvents;
82
83
  private cacheEvents;
@@ -206,6 +206,7 @@ class RootSkillViewController extends AbstractSkillViewController {
206
206
  return __awaiter(this, void 0, void 0, function* () {
207
207
  const startDate = this.calendarVc.getStartDate();
208
208
  let isForceRefresh = false;
209
+ this.syncOffsetWithLocale();
209
210
  if (this.lastStartDate && startDate) {
210
211
  isForceRefresh = this.dates.isSameDay(this.lastStartDate, startDate);
211
212
  }
@@ -373,10 +374,11 @@ class RootSkillViewController extends AbstractSkillViewController {
373
374
  yield this.sm.updateContext(Object.assign(Object.assign({}, options), { people: this.people, events: this.events }));
374
375
  this.client = yield this.connectToApi();
375
376
  const { scope, locale, args, router } = options;
377
+ this.locale = locale;
376
378
  yield Promise.all([
377
379
  this.setupCalendarEventListeners(),
378
380
  locale.on('did-change-timezones', () => {
379
- return this.syncOffsetWithLocale(locale);
381
+ return this.syncOffsetWithLocale();
380
382
  }),
381
383
  this.loadScope(scope),
382
384
  ]);
@@ -393,7 +395,6 @@ class RootSkillViewController extends AbstractSkillViewController {
393
395
  }
394
396
  const { startDate = this.dates.getStartOfDay(), visiblePeopleIds } = args;
395
397
  yield this.calendarVc.renderOnce(() => __awaiter(this, void 0, void 0, function* () {
396
- this.syncOffsetWithLocale(locale);
397
398
  this.optionallyLoadCachedEvents();
398
399
  if (visiblePeopleIds) {
399
400
  yield this.people.setVisibilityMode('custom');
@@ -505,8 +506,8 @@ class RootSkillViewController extends AbstractSkillViewController {
505
506
  const visiblePeople = this.people.getVisiblePeople();
506
507
  this.calendarVc.setPeople(visiblePeople);
507
508
  }
508
- syncOffsetWithLocale(locale) {
509
- const offset = locale.getTimezoneOffsetMinutes();
509
+ syncOffsetWithLocale() {
510
+ const offset = this.locale.getTimezoneOffsetMinutes(this.calendarVc.getStartDate());
510
511
  this.calendarVc.setTimezoneOffsetMs(offset * 60 * 1000);
511
512
  }
512
513
  loadEvents(options) {
@@ -32,6 +32,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
32
32
  private loadEventInterval?;
33
33
  private shouldIgnoreNextDeselectEvent;
34
34
  private lastStartDate?;
35
+ private locale;
35
36
  constructor(options: ViewControllerOptions);
36
37
  getScope: () => ScopeFlag[];
37
38
  private createToolBeltStates;
@@ -48,7 +49,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
48
49
  getToolBeltStateMachine(): CalendarToolBeltStateMachine<import("../types/calendar.types").CalendarToolBeltContext>;
49
50
  getToolBeltStateId(): string | undefined;
50
51
  private CalendarVc;
51
- private handleChangeStartDate;
52
+ protected handleChangeStartDate(): Promise<void>;
52
53
  private makeDateSelectMatchSelectedDateFromCalendar;
53
54
  private setSelectedDateInDateSelectVc;
54
55
  private getStartDate;
@@ -76,7 +77,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
76
77
  private loadPeople;
77
78
  private loadScope;
78
79
  protected syncPeopleOnCalendar(): void;
79
- private syncOffsetWithLocale;
80
+ protected syncOffsetWithLocale(): void;
80
81
  protected loadEvents(options?: LoadEventOptions): Promise<void>;
81
82
  private _loadEvents;
82
83
  private cacheEvents;
@@ -183,6 +183,7 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
183
183
  async handleChangeStartDate() {
184
184
  const startDate = this.calendarVc.getStartDate();
185
185
  let isForceRefresh = false;
186
+ this.syncOffsetWithLocale();
186
187
  if (this.lastStartDate && startDate) {
187
188
  isForceRefresh = this.dates.isSameDay(this.lastStartDate, startDate);
188
189
  }
@@ -332,10 +333,11 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
332
333
  await this.sm.updateContext(Object.assign(Object.assign({}, options), { people: this.people, events: this.events }));
333
334
  this.client = await this.connectToApi();
334
335
  const { scope, locale, args, router } = options;
336
+ this.locale = locale;
335
337
  await Promise.all([
336
338
  this.setupCalendarEventListeners(),
337
339
  locale.on('did-change-timezones', () => {
338
- return this.syncOffsetWithLocale(locale);
340
+ return this.syncOffsetWithLocale();
339
341
  }),
340
342
  this.loadScope(scope),
341
343
  ]);
@@ -352,7 +354,6 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
352
354
  }
353
355
  const { startDate = this.dates.getStartOfDay(), visiblePeopleIds } = args;
354
356
  await this.calendarVc.renderOnce(async () => {
355
- this.syncOffsetWithLocale(locale);
356
357
  this.optionallyLoadCachedEvents();
357
358
  if (visiblePeopleIds) {
358
359
  await this.people.setVisibilityMode('custom');
@@ -447,8 +448,8 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
447
448
  const visiblePeople = this.people.getVisiblePeople();
448
449
  this.calendarVc.setPeople(visiblePeople);
449
450
  }
450
- syncOffsetWithLocale(locale) {
451
- const offset = locale.getTimezoneOffsetMinutes();
451
+ syncOffsetWithLocale() {
452
+ const offset = this.locale.getTimezoneOffsetMinutes(this.calendarVc.getStartDate());
452
453
  this.calendarVc.setTimezoneOffsetMs(offset * 60 * 1000);
453
454
  }
454
455
  async loadEvents(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-calendar-components",
3
3
  "description": "Calendar components for working with calendars and Sprucebot.",
4
- "version": "28.2.36",
4
+ "version": "28.2.38",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },