-
Notifications
You must be signed in to change notification settings - Fork 55
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
Journeys: Time zone issue in journey milestone date. #2199
Comments
This is showing as tomorrow, while 00:01 is in two days oOOoo |
@Idkirsch and I tried, but failed :'( But we had fun hehehehehe |
I think it's something in the react-intl library think that the best format for all times between now and 23 hours and 29 minutes and 59 seconds into the future should be formatted as ex. "in 23 hours", but higher until 1 day and 11:59 later become "tomorrow", then until 2 days and 11:59 it says "in 2 days" etc. (based on some tests, didn't check their code.) In my mind it would make more sense to also consider the current time, ex. if the time is 20:00 then anything higher than 4 hours is "tomorrow" OR anything between 24 and 28 hours is tomorrow, etc. I don't see any obvious way to do this in their docs, but I think they use a (poly filled?) version of Intl.RelativeTimeFormat. Maybe I'm open for spending some time later this week if you this sounds reasonable. (I also spent enough time on Saturday to get annoyed that it didn't get a solution, so looked some more this evening.) |
@Herover @Idkirsch @troldmand I love all the explorations you have done of this! So frustrating that you didn't find a solution over the weekend, but as you probably know, every time you research or attempt to solve time related bugs a magical koala baby gets its wings 🐨 🦄 🪽 @Herover go for it! I think your ideas sound cool! |
Thanks @ziggabyte, and go nuts @Herover. Maybe @Idkirsch and I would also look into another fix on Thursday ☮️ we will post her before picking up any work, hope you will the same @Herover 🤙 |
We have a patch for this now! :) But it could be improved, see the review comment on the PR. |
Description.
When I set the date of a milestone of a journey, the representation of that date in relative time in the "Next milestone deadline" column in the journeys list is not correct. This (i think) is because that when the milestone date is set, it's set at the time of
00:00:00
on the selected date. So in the journeys list this is the time that comes from the server, and then is converted to local time of the browser (for me currently in Sweden, that means it adds 2 hours).Steps to reproduce
organize/{orgId}/journeys
Expected Behaviour
It correctly says that the next milestone deadline is two days from now
Actual Behaviour
It says that the next milestone deadline is tomorrow
Screenshots (if you have any)
In this screenshot, Sept 30 is correct, that is the date that i chose for the milestone - but "tomorrow" is incorrect, as you see the date of the day i did this is Sept 28th.
The text was updated successfully, but these errors were encountered: