front: adapt train header for hourly timetables - #18099
Draft
emersion wants to merge 21 commits into
Draft
Conversation
DurationCell's declaration is difficult to read because its props type is non-trivial. Extract that to a separate type. Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
This function performs manual time manipulation. Move truncateToSecond() to shared utils and use that instead. Will help with hourly timetables as well. Signed-off-by: Simon Ser <contact@emersion.fr>
This mirrors a subset of the Temporal API, to make migration easier to the standard once we can upgrade: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Duration/toLocaleString `style` and `hours` are forced to a single value because we only need these variations from the standard API. Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
formatLocalTime() is not suitable for presenting a time value to a human: it's meant for `<input type="time">`. Use toLocaleTimeString() instead. Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
DurationCell will be used to edit time values relative to the start of a timetable for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
This component selects between TimeCell and DurationCell depending on the StartTime variant. Signed-off-by: Simon Ser <contact@emersion.fr>
The Temporal API also supports this unit. Signed-off-by: Simon Ser <contact@emersion.fr>
Instead, use the Duration class. This will simplify hourly timetable support in upcoming commits. Signed-off-by: Simon Ser <contact@emersion.fr>
Change types from Date to StartTime, using all of the toys introduced in previous commits. Signed-off-by: Simon Ser <contact@emersion.fr>
Dates don't make sense for hourly timetables. Signed-off-by: Simon Ser <contact@emersion.fr>
emersion
force-pushed
the
emr/train-header-hourly-timetable
branch
from
August 12, 2026 14:59
4702fb6 to
6f1d18c
Compare
Signed-off-by: Simon Ser <contact@emersion.fr>
Use Date.toLocale{Date,Time}String() for proper localization.
Signed-off-by: Simon Ser <contact@emersion.fr>
TODO: trash icon is cut off Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
emersion
force-pushed
the
emr/train-header-hourly-timetable
branch
from
August 12, 2026 15:12
6f1d18c to
8caef6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References: #17626