Skip to content

Days of Week Meetings Pull Google Calendar Data from Anchor Dates #221

@kylebtran

Description

@kylebtran

This bug stems from the intersection between PRs #203 and #177.

Summary

Creating meetings using days of the week internally utilizes anchor dates to standardize the order and interpretation of such days:

// chrono.ts

export const ANCHOR_DATES: Date[] = [
    new Date(Date.UTC(2023, 0, 1)),
    new Date(Date.UTC(2023, 0, 2)),
    new Date(Date.UTC(2023, 0, 3)),
    new Date(Date.UTC(2023, 0, 4)),
    new Date(Date.UTC(2023, 0, 5)),
    new Date(Date.UTC(2023, 0, 6)),
    new Date(Date.UTC(2023, 0, 7)),
];

When Google Calendar events are requested for overlay on personal-availability.tsx, it will send the anchor dates instead of the current week, ultimately retrieving outdated information.

The probable solution is to convert the original day to the current week's counterpart, and use those dates in the API call. The returned data may need to be reconverted or interpreted to overlay back onto the original anchor dates, whether by date or day.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions