Skip to content

feat: implement DateWithoutTimezone scalar and update visit registration handling to prevent timezone shifts - #1856

Open
yoganandaness wants to merge 8 commits into
developfrom
SWAP-5795-prevent-timezone-shifts-in-visit-registration-date
Open

yoganandaness wants to merge 8 commits into
developfrom
SWAP-5795-prevent-timezone-shifts-in-visit-registration-date

Conversation

@yoganandaness

Copy link
Copy Markdown
Contributor

Description

Optimized Visit registration to be timezone agnostic. Currently, it has also been made time agnostic. ex., 2026-10-02T04:00 will be saved as 2026-10-02T00:00, since the current system supports only date submission. When the system starts supporting time selection, the same can be saved in the database. For now., the time is defaulted to the start of the day.

Motivation and Context

The current Visit registration module has multiple issues

  1. The start and end dates are submitted with timezones. This leads to saving of wrong dates in database
  2. The start and end dates, when retrieved from the Postgres, gets changed when getting converted into js date object.

Due to the above issues, there are multiple uncertainties surrounding the dates. ex., user officer looking at start and end date, which are different from what was submitted by the science users.

The goal is simple: When the user selects a start date and ends date, it is obvious that the dates are as per the timezone of the facility and not the user's browser location. Hence the whole workflow of the visit registration system must be timezone agnostic.

How Has This Been Tested

Both e2e and unit has been included

Fixes

Uncertainty around time and timezone issue with user visit registration submission

Changes

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@yoganandaness
yoganandaness requested a review from a team as a code owner October 2, 2026 15:05
@yoganandaness
yoganandaness requested review from ACLay, SourangshuSTFC, janosbabik and zacharyjhankin and removed request for a team and ACLay October 2, 2026 15:05
const { updateVisitRegistration } = await api.updateVisitRegistration(update);
const payload: UpdateVisitRegistrationMutationVariables = {
...update,
startsAt: update.startsAt,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this because startsAt is in update already?

@zacharyjhankin zacharyjhankin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works, code seems to make sense

@zacharyjhankin

Copy link
Copy Markdown
Collaborator

I am thinking, is the same fix needed for the call.start_call, call.end_call, call.start_review and call.end_review data fields?

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants