diff --git a/src/components/mui/EventCard/index.js b/src/components/mui/EventCard/index.js index 036c9a2..ababd06 100644 --- a/src/components/mui/EventCard/index.js +++ b/src/components/mui/EventCard/index.js @@ -54,7 +54,8 @@ const EventCard = ({ event = {}, onClick, sx }) => { year: 'numeric', hour: '2-digit', minute: '2-digit', - hour12: true + hour12: true, + timeZone: 'Asia/Kolkata' }).format(new Date(event_date)) : null diff --git a/src/configs/themeConfig.js b/src/configs/themeConfig.js index e73233a..ee03a13 100644 --- a/src/configs/themeConfig.js +++ b/src/configs/themeConfig.js @@ -42,7 +42,7 @@ const themeConfig = { // ** Event Platform maxFileUploadMB: 10, - defaultTimezone: 'UTC', + defaultTimezone: 'Asia/Kolkata', dateFormat: 'MMM DD, YYYY', timeFormat: 'hh:mm A' } diff --git a/src/services/email-service.js b/src/services/email-service.js index f8de8b6..7bc2a06 100644 --- a/src/services/email-service.js +++ b/src/services/email-service.js @@ -20,7 +20,8 @@ function fmtDate(iso) { if (!iso) return 'TBA' return new Date(iso).toLocaleDateString('en-IN', { - weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' + weekday: 'long', day: 'numeric', month: 'long', year: 'numeric', + timeZone: 'Asia/Kolkata' }) } @@ -28,7 +29,8 @@ function fmtTime(iso) { if (!iso) return '' return new Date(iso).toLocaleTimeString('en-IN', { - hour: 'numeric', minute: '2-digit', hour12: true + hour: 'numeric', minute: '2-digit', hour12: true, + timeZone: 'Asia/Kolkata' }) } diff --git a/src/views/events/EventDetailView.js b/src/views/events/EventDetailView.js index 05d9278..31fd003 100644 --- a/src/views/events/EventDetailView.js +++ b/src/views/events/EventDetailView.js @@ -32,7 +32,8 @@ function formatDate(iso) { weekday: 'long', day: 'numeric', month: 'long', - year: 'numeric' + year: 'numeric', + timeZone: 'Asia/Kolkata' }) } @@ -41,7 +42,8 @@ function formatTime(iso) { return new Date(iso).toLocaleTimeString('en-IN', { hour: '2-digit', minute: '2-digit', - hour12: true + hour12: true, + timeZone: 'Asia/Kolkata' }) } diff --git a/src/views/events/EventsPageView.js b/src/views/events/EventsPageView.js index 0391343..4a50f8f 100644 --- a/src/views/events/EventsPageView.js +++ b/src/views/events/EventsPageView.js @@ -37,9 +37,11 @@ const EVENTS_PER_PAGE = 6 function parseEventDate(iso) { if (!iso) return { full: '' } const d = new Date(iso) - const weekday = d.toLocaleDateString('en-US', { weekday: 'long' }) - const month = d.toLocaleDateString('en-US', { month: 'long' }) - return { full: `${weekday}, ${month} ${d.getDate()}, ${d.getFullYear()}` } + 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}` } } /** @@ -50,7 +52,7 @@ function parseEventDate(iso) { */ function formatEventTime(iso) { if (!iso) return '' - return new Date(iso).toLocaleTimeString('en-IN', { hour: '2-digit', minute: '2-digit', hour12: true }) + return new Date(iso).toLocaleTimeString('en-IN', { hour: '2-digit', minute: '2-digit', hour12: true, timeZone: 'Asia/Kolkata' }) } /**