Skip to content

Commit

Permalink
Display event times with correct time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
brundonsmith committed Jan 27, 2024
1 parent 623103e commit 0ed1c41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions front-end/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import React from 'react'
import { createRoot } from 'react-dom/client'

import App from './components/App'

dayjs.extend(utc)

window.addEventListener('load', () => {
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('/sw.js')
Expand Down
8 changes: 4 additions & 4 deletions front-end/src/stores/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Store {

return {
...festival,
start_date: dayjs(festival.start_date),
end_date: dayjs(festival.end_date),
start_date: dayjs.utc(festival.start_date),
end_date: dayjs.utc(festival.end_date),
} as const
} else {
return null
Expand Down Expand Up @@ -118,8 +118,8 @@ class Store {
return (await vibefetch(this.jwt, '/events', 'get', undefined)).body?.events
.map(e => ({
...e,
start_datetime: dayjs(e.start_datetime),
end_datetime: e.end_datetime ? dayjs(e.end_datetime) : null
start_datetime: dayjs.utc(e.start_datetime),
end_datetime: e.end_datetime ? dayjs.utc(e.end_datetime) : null
}))
} else {
return null
Expand Down

0 comments on commit 0ed1c41

Please sign in to comment.