OpenRailAssociation / OpenRailAssociation/osrd

front: clean date manipulation in TS v2

Open
#8,166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:front kind:enhancement kind:refacto-task
Dominant language
TypeScript
Stars
660
Forks
87
Avg merge
3d 4h
Merged PRs (30d)
269

Description

Description and goal

The date manipulation in TS v2 is quite shady for the moment. Sometimes, the date received from editoast is formatted several times, but it should be formatted only once at the end, just before displaying it.

The date in ts v2 is displayed at least in the following components:

  • timetable card
  • get
  • output table
  • driver schedule

[!NOTE]

The transformation process is weird, for example the train.startTime process is as follows 🤯:

  1. String ISO8601
  2. Dayjs obj
  3. String custom DD/MM/YYYY HH:mm:ss
  4. Date obj
  5. Dayjs obj
  6. String custom DD/MM HH:mm:ss
Acceptance criteria
  • the date is formatted only once for each workflow

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing date handling in the TS v2 timetable card, get, output table, and driver schedule components. Identify where each workflow transforms the date, then verify that formatting occurs only once at the end, just before display.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.