-
Notifications
You must be signed in to change notification settings - Fork 45
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
front: use Date instead of string in OsrdConfState.startTime #9954
Conversation
d0a78a8
to
590695a
Compare
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.
Nice cleaning !! Thanks !
Found a bug:
- when editing a train, the date is not displayed
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.
LGTM (except for the bug mentioned by @clarani), tested ✅
Ooops, sounds like export const formatLocalDateTime = (date: Date) =>
- dayjs(date).local().format('YYYY-MM-DDTHH:MM:SS');
+ dayjs(date).local().format('YYYY-MM-DDTHH:mm:ss'); |
590695a
to
dc40969
Compare
dc40969
to
5b07ebf
Compare
Improves type safety. While at it, fix a small typo: s/substractTo/subtractFrom/ Signed-off-by: Simon Ser <contact@emersion.fr>
Improves type safety. Signed-off-by: Simon Ser <contact@emersion.fr>
Improves type safety. Previously, it was important for OsrdConfState.startTime to be in a specific timezone, because the string was later truncated and directly used on an datetime-local form input. This patch improves robustness by converting to the local timezone right before feeding the value to the datetime-local form input, making it so a different timezone in OsrdConfState.startTime doesn't break the app. IsoDateTimeString is not longer used and can be dropped. Signed-off-by: Simon Ser <contact@emersion.fr>
startTime should be used instead, because it's an already-parsed Date object instead of a string. Signed-off-by: Simon Ser <contact@emersion.fr>
5b07ebf
to
252b871
Compare
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.
LGTM, tested ✅
See individual commits.
Improves type safety.