Skip to content

front: adapt train header for hourly timetables - #18099

Draft
emersion wants to merge 21 commits into
devfrom
emr/train-header-hourly-timetable
Draft

front: adapt train header for hourly timetables#18099
emersion wants to merge 21 commits into
devfrom
emr/train-header-hourly-timetable

Conversation

@emersion

Copy link
Copy Markdown
Member

References: #17626

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>
@github-actions github-actions Bot added the area:front Work on Standard OSRD Interface modules label Aug 12, 2026
@emersion emersion moved this to In Progress in Board PI 21 Aug 12, 2026
@emersion emersion self-assigned this Aug 12, 2026
@emersion
emersion force-pushed the emr/train-header-hourly-timetable branch from 4702fb6 to 6f1d18c Compare August 12, 2026 14:59
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
emersion force-pushed the emr/train-header-hourly-timetable branch from 6f1d18c to 8caef6c Compare August 12, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Work on Standard OSRD Interface modules

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant