Mockup "pat-moment" and language specific formatting?

The following markup

<span class="pat-moment" data-pat-moment="format:relative;">2020-04-07T15:41:22+02:00</span>

is randomly rendered as "23. Januar 2020" or "January 23, 2020 2:05 PM" when reloading the same Plone 5.2 browser view. Some I see that the JS code changes to the German format and then switches back to the US format within the same(!) page load. So completely random rendering.

Apart from that: it is ugly and not very user friendly changing the formatting of visible elements...visual artifacts..but other tools like Jira behave in the same way (they render the UI first in English and then replace the strings through JS with their translated versions)....not nice.

Consequence: throwing pat-moment out of the window and replacing it with traditional server-side rendering using toLocalizedTime() is most probably the reason. should be the way forward.

Just didn't have time to work on it... did some simple template overrides for client projects so far.

1 Like