Skip to content

Display timestamps in IST without affecting existing format or tests

Laxman Reddy requested to merge fix/convert-gmt-to-ist into develop

Here is your clean copy-paste MR description 👇


What does this MR do and why?

This MR updates the frontend to display all timestamps in Indian Standard Time (IST - Asia/Kolkata) instead of UTC/GMT.

Previously, backend timestamps (stored in UTC) were rendered directly in the UI, causing incorrect time display for India-based users.

Changes made:

  • Introduced a centralized utility function formatToIST() in src/lib/utils.ts
  • Updated relevant UI components to use formatToIST for timestamp rendering
  • Preserved existing date format (Feb 1, 2024) to avoid breaking tests
  • No backend changes were made
  • All unit tests (393/393) pass
  • Production build verified successfully

Why this change?

  • Ensure correct local time display for Indian users
  • Improve UI consistency
  • Avoid timezone confusion
  • Maintain best practice by keeping backend time storage in UTC

References

  • Requirement: Display timestamps in IST for India deployment
  • Timezone used: Asia/Kolkata
  • Utility file: src/lib/utils.ts

Screenshots or screen recordings

Before (UTC) After (IST)
10:28:57 AM 4:01:57 PM
UTC display IST display

Example:

  • Before: Feb 1, 2024 10:28 AM
  • After: Feb 1, 2024 4:01 PM

How to set up and validate locally

  1. Checkout this branch:

    git checkout <branch-name>
  2. Install dependencies:

    npm install
  3. Run tests:

    npm run test

    All tests should pass.

  4. Start development server:

    npm run dev
  5. Verify:

    • Assign Doctor page timestamps
    • Consultation history timestamps
    • Queue timestamps
    • Prescription dispensing timestamps All should display IST.
  6. Verify production build:

    npm run build

MR acceptance checklist

  • No backend logic changed
  • No database changes
  • Centralized timezone handling
  • No test regressions
  • All tests pass
  • TypeScript build successful
  • Production build verified
  • No security impact
  • No performance impact
  • Maintainable utility-based implementation

Merge request reports

Loading