Skip to content

fix: timezone fix on mail, changed utc to asia/kolkata - #69

Merged
Bhav-ikkk merged 1 commit into
mainfrom
fix/timezone-fix-in-mail
Apr 3, 2026
Merged

fix: timezone fix on mail, changed utc to asia/kolkata#69
Bhav-ikkk merged 1 commit into
mainfrom
fix/timezone-fix-in-mail

Conversation

@Bhav-ikkk

@Bhav-ikkk Bhav-ikkk commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Bug Fixes
    • Updated event date and time formatting across the application to consistently display times in the Asia/Kolkata timezone. Changes affect event cards, event detail views, event listings, email notifications, and platform configuration settings. This replaces the previous UTC default with explicit Asia/Kolkata timezone specification.

Copilot AI review requested due to automatic review settings April 2, 2026 04:00
@github-actions github-actions Bot added the size/s label Apr 2, 2026
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request updates date and time formatting across multiple components and services to consistently use the Asia/Kolkata time zone instead of UTC. Changes include updating the theme configuration, adding explicit timeZone: 'Asia/Kolkata' options to Intl.DateTimeFormat calls, and modifying helper functions in event views and email services.

Changes

Cohort / File(s) Summary
Configuration
src/configs/themeConfig.js
Updated defaultTimezone from 'UTC' to 'Asia/Kolkata'.
Components
src/components/mui/EventCard/index.js
Added explicit timeZone: 'Asia/Kolkata' option to Intl.DateTimeFormat for formattedDate generation.
Views
src/views/events/EventDetailView.js, src/views/events/EventsPageView.js
Added timeZone: 'Asia/Kolkata' to date and time formatting helper functions; EventsPageView also modified date assembly format from weekday-first to day/year structure.
Services
src/services/email-service.js
Added timeZone: 'Asia/Kolkata' to fmtDate and fmtTime functions for ticket email rendering in both HTML and plain-text templates.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

size/s

Poem

🐰 Through Asia's lands where Kolkata shines bright,
The dates now dance in the correct time light.
No more UTC's distant, cold call—
Our timestamps bloom in sync with it all! 🌍✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title correctly identifies the main change: timezone handling has been shifted from UTC to Asia/Kolkata across multiple files. However, the scope is broader than just mail—changes span EventCard, themeConfig, EventDetailView, and EventsPageView, not only email-service.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/timezone-fix-in-mail

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bhav-ikkk Bhav-ikkk changed the title Fixed Time issue from mail, changed UTC to Asia/Kolkata fix: timezone fix on mail, changed utc to asia/kolkata Apr 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates date/time formatting across event views and email templates to consistently render in Asia/Kolkata (instead of falling back to server/SSR UTC), aligning UI and outbound communications with the intended local timezone.

Changes:

  • Added timeZone: 'Asia/Kolkata' to multiple toLocaleDateString/toLocaleTimeString/Intl.DateTimeFormat usages.
  • Fixed EventsPageView date parsing to avoid mixing getDate()/getFullYear() (server-local) with locale formatting by deriving day/year via locale formatting in the target timezone.
  • Switched themeConfig.defaultTimezone from UTC to Asia/Kolkata.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/views/events/EventsPageView.js Formats event date/time using Asia/Kolkata to prevent SSR UTC shifts; adjusts date parsing to be timezone-consistent.
src/views/events/EventDetailView.js Ensures event detail date/time display is formatted in Asia/Kolkata.
src/services/email-service.js Ensures email date/time strings render in Asia/Kolkata (prevents UTC times in emails).
src/configs/themeConfig.js Updates configured default timezone to Asia/Kolkata.
src/components/mui/EventCard/index.js Ensures card-level event datetime display is formatted in Asia/Kolkata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +44
const weekday = d.toLocaleDateString('en-US', { weekday: 'long', timeZone: 'Asia/Kolkata' })
const month = d.toLocaleDateString('en-US', { month: 'long', timeZone: 'Asia/Kolkata' })
const day = d.toLocaleDateString('en-US', { day: 'numeric', timeZone: 'Asia/Kolkata' })
const year = d.toLocaleDateString('en-US', { year: 'numeric', timeZone: 'Asia/Kolkata' })
return { full: `${weekday}, ${month} ${day}, ${year}` }

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

parseEventDate builds the final string by calling toLocaleDateString four separate times. This is harder to maintain and does extra work; it can be replaced with a single toLocaleDateString (or Intl.DateTimeFormat) call that includes weekday/month/day/year and timeZone: 'Asia/Kolkata' to produce the same output deterministically.

Suggested change
const weekday = d.toLocaleDateString('en-US', { weekday: 'long', timeZone: 'Asia/Kolkata' })
const month = d.toLocaleDateString('en-US', { month: 'long', timeZone: 'Asia/Kolkata' })
const day = d.toLocaleDateString('en-US', { day: 'numeric', timeZone: 'Asia/Kolkata' })
const year = d.toLocaleDateString('en-US', { year: 'numeric', timeZone: 'Asia/Kolkata' })
return { full: `${weekday}, ${month} ${day}, ${year}` }
const full = d.toLocaleDateString('en-US', {
weekday: 'long',
month: 'long',
day: 'numeric',
year: 'numeric',
timeZone: 'Asia/Kolkata'
})
return { full }

Copilot uses AI. Check for mistakes.
// ** Event Platform
maxFileUploadMB: 10,
defaultTimezone: 'UTC',
defaultTimezone: 'Asia/Kolkata',

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

defaultTimezone is only defined here; a repo-wide search shows no other references. Consider either wiring date/time formatting to read from this config (to avoid hardcoding 'Asia/Kolkata' in multiple places) or removing it to prevent an unused setting from becoming misleading over time.

Suggested change
defaultTimezone: 'Asia/Kolkata',

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/views/events/EventDetailView.js (1)

68-68: Pre-existing issue: Festival countdown date lacks timezone specification.

The FEST_START constant at line 68 parses '2026-04-07T09:00:00' without a timezone offset. JavaScript interprets this as local time (server or browser), which may differ from Asia/Kolkata. Since this PR is standardizing on IST, consider specifying the timezone explicitly:

-const FEST_START = new Date('2026-04-07T09:00:00').getTime()
+const FEST_START = new Date('2026-04-07T09:00:00+05:30').getTime()

This ensures the countdown is consistent regardless of where the code executes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/views/events/EventDetailView.js` at line 68, FEST_START currently parses
'2026-04-07T09:00:00' without a timezone, which yields local-time interpretation
and breaks IST consistency; update the FEST_START constant in EventDetailView.js
to create the timestamp with an explicit IST offset (e.g. use the ISO string
with +05:30 like '2026-04-07T09:00:00+05:30' or construct via UTC utilities) so
new Date(...) yields the intended Asia/Kolkata moment regardless of
server/browser timezone.
src/configs/themeConfig.js (1)

45-45: Config value defined but not used by formatting functions.

The defaultTimezone is set to 'Asia/Kolkata' in themeConfig.js, but the timezone formatting functions across the codebase (EventsPageView, UpcomingEventsScroller, FeaturedEvents, CartView, EventDetailView, generateTicketPDF, email-service, etc.) hardcode the timezone string directly instead of importing and using themeConfig.defaultTimezone.

If the timezone needs to change in the future, all files must be updated individually.

Consider having the formatting helpers import and reference this config value for better maintainability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/configs/themeConfig.js` at line 45, Update timezone handling to use the
central config: import defaultTimezone from themeConfig (the exported
defaultTimezone constant) into the formatting helper modules and components
(e.g., where EventsPageView, UpcomingEventsScroller, FeaturedEvents, CartView,
EventDetailView, generateTicketPDF, email-service format times) and replace
hardcoded timezone strings with that imported defaultTimezone; ensure any helper
functions that accept a timezone parameter default to
themeConfig.defaultTimezone and update all calls to use the helper so changing
themeConfig.defaultTimezone updates behavior everywhere.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/configs/themeConfig.js`:
- Line 45: Update timezone handling to use the central config: import
defaultTimezone from themeConfig (the exported defaultTimezone constant) into
the formatting helper modules and components (e.g., where EventsPageView,
UpcomingEventsScroller, FeaturedEvents, CartView, EventDetailView,
generateTicketPDF, email-service format times) and replace hardcoded timezone
strings with that imported defaultTimezone; ensure any helper functions that
accept a timezone parameter default to themeConfig.defaultTimezone and update
all calls to use the helper so changing themeConfig.defaultTimezone updates
behavior everywhere.

In `@src/views/events/EventDetailView.js`:
- Line 68: FEST_START currently parses '2026-04-07T09:00:00' without a timezone,
which yields local-time interpretation and breaks IST consistency; update the
FEST_START constant in EventDetailView.js to create the timestamp with an
explicit IST offset (e.g. use the ISO string with +05:30 like
'2026-04-07T09:00:00+05:30' or construct via UTC utilities) so new Date(...)
yields the intended Asia/Kolkata moment regardless of server/browser timezone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7606ce18-8841-4bdf-af13-31da671b8290

📥 Commits

Reviewing files that changed from the base of the PR and between b4f0031 and c4ee6ac.

📒 Files selected for processing (5)
  • src/components/mui/EventCard/index.js
  • src/configs/themeConfig.js
  • src/services/email-service.js
  • src/views/events/EventDetailView.js
  • src/views/events/EventsPageView.js

@Bhav-ikkk
Bhav-ikkk merged commit cb2cc1c into main Apr 3, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants