[openstreetmap/openstreetmap-website] Update relative timestamps dynamically (Issue #6534)
Minh Nguyễn
notifications at github.com
Thu Nov 20 20:55:59 UTC 2025
1ec5 left a comment (openstreetmap/openstreetmap-website#6534)
Yes, we can avoid a user-perceptible relayout by hooking into the [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event) event. If we were to do a lot of work in the event handler, the user would notice a delayed relayout, but we hardly use this hook for anything yet, and replacing the contents of a few `<time>` tags with formatted dates would be very efficient.
I think this would be easier than ensuring consistency between server- and client-formatted timestamps. As far as I can tell, rails-i18n is one of the few popular internationalization libraries these days that doesn’t directly use CLDR for date formats or their translations.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6534#issuecomment-3560009772
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/6534/3560009772 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251120/106f398d/attachment.htm>
More information about the rails-dev
mailing list