Skip to content

Fix timezone handling causing newly created events to disappear (#108)#212

Open
sakshibhatia17 wants to merge 1 commit into
Cefalo:developfrom
sakshibhatia17:fix/issue-108-events-memory
Open

Fix timezone handling causing newly created events to disappear (#108)#212
sakshibhatia17 wants to merge 1 commit into
Cefalo:developfrom
sakshibhatia17:fix/issue-108-events-memory

Conversation

@sakshibhatia17

Copy link
Copy Markdown

Summary

This PR fixes Issue #108.

Root Cause

The frontend extracted dates using toISOString().split('T')[0], which converts local time to UTC before extracting the date. For users in timezones ahead of UTC (e.g. IST), newly created events could be assigned to the previous calendar day, causing them to be filtered out from "My Events".

Additionally, the mock database could throw an error when iterating over events without attendees.

Changes

  • Replaced toISOString().split('T')[0] with dayjs().format('YYYY-MM-DD') to preserve the user's local calendar date.
  • Added a null check before iterating over event.attendees in the mock database.
  • Removed all temporary debugging code.

Verification

  • Created a new event and verified it appears immediately in My Events.
  • Verified both frontend and backend build successfully.
  • Confirmed the issue is resolved.
{E8AA364D-1BD7-4C33-87EA-D0CE938E1F69}

Fixes #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] in-memory events data is being reset after creating a new event

1 participant