Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

III-6151 fix timezone issues latest #946

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

simon-debruijn
Copy link
Contributor

@simon-debruijn simon-debruijn commented Oct 30, 2024

Added

  • Add test for timezone

Changed

  • Install more recent date-fns and tz
  • Convert timezone in changeOfferCalendar
  • Convert timezone in addEvent
  • Convert timezone in getEventById
  • Convert start and endDate in addEvent

Ticket: https://jira.uitdatabank.be/browse/III-6151

Copy link

sentry-io bot commented Oct 30, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/hooks/api/events.ts

Function Unhandled Issue
getEventById RangeError: Invalid time value /events/[eventId]/...
Event Count: 6 Affected Users: 0
getEventById TypeError: Cannot read properties of undefined (reading 'map') /events/...
Event Count: 4 Affected Users: 0

Did you find this useful? React with a 👍 or 👎

@simon-debruijn simon-debruijn marked this pull request as ready for review November 5, 2024 10:23
@simon-debruijn
Copy link
Contributor Author

The e2e tests also work when I set the global timezoneId to 'Asia/Tokyo'.
It seems to work, but I'm also not 100% sure if we cover all cases or introduce new unexpected behaviour.

async (page) => {
await page.goto(url);
const startHour = page.getByLabel('Beginuur');
expect(await startHour.inputValue({ timeout: 10_000 })).toEqual('01:00');
Copy link
Contributor

@brampauwelyn brampauwelyn Nov 6, 2024

Choose a reason for hiding this comment

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

It will always be 01:00 I guess?
Even if we change the timezone here to Tokyo?

Or will it display the time with the Tokyo timezine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The time should always show the time value you'd expect. SO indeed if the timezone is Tokyo or Brussels the time value should be 01:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants