stable

Clone or download

Read-only

refactor: replace moment by Intl.DateTimeFormat

part of request #35496 Drop moment.js from places using tlp-relative-date How to test: No functional change in cross-tracker search widget. When you enter a query that matches some artifacts, their last update date is formatted (date only) according to your timezone and locale as before. Why? Moment.js has been useful for formatting dates, but it is end-of-life now. Native platform alternatives now exist in our supported browsers, such as Intl.DateTimeFormat. Using them also has the advantage of significantly reducing the bundled JavaScript weight: 378.68 kB -> 318.40 kB for cross-tracker search. Change-Id: Iaca3c5f4bae3b4637771ccc9191a9dfdb6050edf

Modified Files

Name
M lib/frontend/constants/package.json +2 −1 Go to diff View file
M lib/frontend/constants/src/main.ts +2 −1 Go to diff View file
A lib/frontend/date-helper/README.md +84 −0 Go to diff View file
M lib/frontend/date-helper/package.json +6 −5 Go to diff View file
A lib/frontend/date-helper/src/IntlFormatter.test.ts +88 −0 Go to diff View file
A lib/frontend/date-helper/src/IntlFormatter.ts +102 −0 Go to diff View file
A lib/frontend/date-helper/src/date-only.test.ts +36 −0 Go to diff View file
R plugins/crosstracker/scripts/cross-tracker/src/user-service.ts Go to diff View file
A lib/frontend/date-helper/src/dom.test-d.ts +33 −0 Go to diff View file
A lib/frontend/date-helper/src/dom.test.ts +51 −0 Go to diff View file
A lib/frontend/date-helper/src/dom.ts +40 −0 Go to diff View file
R lib/frontend/date-helper/src/index.test.ts Go to diff View file
R lib/frontend/date-helper/src/index.ts Go to diff View file
A lib/frontend/date-helper/src/main.ts +24 −0 Go to diff View file
M lib/frontend/date-helper/tsconfig.json +3 −0 Go to diff View file
M lib/frontend/date-helper/vite.config.ts +2 −2 Go to diff View file
M plugins/crosstracker/include/CrossTracker/Widget/ProjectCrossTrackerSearchPresenter.php +5 −11 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/package.json +0 −1 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/pnpm-lock.yaml +0 −7 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/ArtifactTable.test.ts +6 −0 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/components/ArtifactTable.vue +5 −6 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/index.ts +6 −13 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/injection-symbols.ts +2 −0 Go to diff View file
M plugins/crosstracker/scripts/cross-tracker/src/writing-mode/TrackerSelection.test.ts +7 −3 Go to diff View file
M plugins/crosstracker/templates/widgets/project-cross-tracker-search.mustache +0 −1 Go to diff View file