Skip to content

Unify date formatting, base it on locale#1564

Open
Arnei wants to merge 1 commit intoopencast:developfrom
Arnei:date-display-unification
Open

Unify date formatting, base it on locale#1564
Arnei wants to merge 1 commit intoopencast:developfrom
Arnei:date-display-unification

Conversation

@Arnei
Copy link
Copy Markdown
Member

@Arnei Arnei commented Apr 7, 2026

Originally #1509

This patch aims for a consistent date display across the entire ui. That it is not always consistent can be seen for example in the event details metadata, where the start date is formatted differently from the created date.

Furthermore, this patch aims to base date formatting more on the chosen locale to create a more intuitive experience for users. No more A.M./P.M. in the german locale for example.

To achieve this, date-fns is chosen as the gold standard and momentjs is removed from the project completely. Not only because moment is legacy, but also because our datepickers were using date-fns already and will not use anything else.

Additionally, this removes our custom date formatting from the translation files and replaces it with date-fns tokens. In my opinion, we do not need to try and be smarter than our datetime library when it comes to formatting dates. Translators retain the ability to enforce their favourite
formatting should they so chose,
but will have to be aware that it will not be respect everywhere, e.g. not in the datepickers.

This patch contains changes to all translation files. I am aware that everything except en_US will get overwritten, the changes to other languages are merely for ease of reviewing. If this patch is merged, the translations should be adapted asap as per this example.

@Arnei Arnei added the type:enhancement New feature or request label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/admin-interface:pr-1564

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/admin-interface:pr-1564

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

This pull request is deployed at test.admin-interface.opencast.org/1564/2026-04-09_08-53-46/ .
It might take a few minutes for it to become available.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

This patch aims for a consistent date display across the entire
ui. That it is not always consistent can be seen for example in the
event details metadata, where the start date is formatted differently
from the created date.

Furthermore, this patch aims to base date formatting more on the
chosen locale to create a more intuitive experience for users.
No more A.M./P.M. in the german locale for example.

To achieve this, date-fns is chosen as the gold standard and momentjs
is removed from the project completely. Not only because
moment is legacy, but also because our datepickers were
using date-fns already and will not use anything else.

Additionally, this removes our custom date formatting from
the translation files and replaces it with date-fns tokens. In my
opinion, we do not need to try and be smarter than our datetime
library when it comes to formatting dates. Translators retain the
ability to enforce their favourite
formatting should they so chose,
but will have to be aware that it will not be respect everywhere,
e.g. not in the datepickers.

This patch contains changes to all translation files. I am aware that
everything except en_US will get overwritten, the changes to other
languages are merely for ease of reviewing. If this patch is merged,
the translations should be adapted asap as per this example.
@Arnei Arnei force-pushed the date-display-unification branch from 0563f20 to a6a8232 Compare April 9, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant