-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: display departure times and search time in CET, regardless of which timezone the users is located in #234
Conversation
…arch time selectore in CTE, regardless of which time zone the user is located in.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
You didn't require any changes in how the date is listed in search results? That seems odd to me as dates are provided in UTC so printing local time on the client when providing from the server intuitively would be wrong, no? |
Don't we always operate with UTC dates, or are they converted to local date when parsed from ISO? |
When formatting as string the local time is used. As input in the date selector parsing without timezone is done so that will probably also use local timezone 🤔 |
…ng from detailed view back to search results. + some minor updates in the code.
setTimezoneIfNeeded is used in the search time selector to display in CET. When creating a tripQuery during a search in client/journey-planner, formatCETToLocal() formates the search time from CET to local time. Then, in trip() on the server side, the search time is again formated from local time to UTC before the search towards the db is performed. I am not exactly sure where the search results are formated from UTC to local time, but it could be when parsed from ISO. Therefore, to formate from local to CET before displaying the trip departure times, the setTimezoneIfNeeded() is implemented into formateToClock(). |
|
|
In regards to testing with changed time zones, testing to vercel preview release is probably more realistic as locally it could be different with server time |
Timezone testing in previewThese are the test results when searching after trips from different timezones in preview. CET (+0100) ✅
EET (+0200) ✅
UTC (+0000) ✅
PST (-0800) ✅
|
Lets look into how to write playwright tests here @jonasbrunvoll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a couple test to make sure that we don't break anything.
After the deployment action hook change for Playwright tests it takes longer for GH to discover playwright tests and run them. So they aren't run yet. Think it is good to wait for them to run |
Oh, that's right. I just glanced at the checks to see if all were green 🫣 |
Is there some way to force GH to discover and run the playwright tests, or do we just wait until GH finds them? |
They are visible here: https://github.com/AtB-AS/planner-web/actions/workflows/playwright.yml looks like it takes some time before it runs, so think we could look into if this can be improved somewhat |
Closes https://github.com/AtB-AS/kundevendt/issues/16880
Background
We have received feedback from users outside the Central European Timezone (CET), that when searching for trips, the departure times are displayed in their local time and not in CET. The trips should always be displayed in CET to avoid confusion.
Proposed solution
Added functionality to display departure times and the time in the search time selector in CTE, regardless of which timezone the user is located in.
Acceptance Criteria
Test input
To test this feature, change the internal clock of the computer to the listed timezones. The departure times should and the search time selector should always be shown in CTE time.