zetkin / www.zetk.in

The main activist front-end for Zetkin.
https://www.zetk.in
4 stars 7 forks source link

Fix undocumented Nynorsk date render issue #287

Closed richardolsson closed 3 years ago

richardolsson commented 3 years ago

This PR updates zetkin-common, in which a new ClientSideFormattedDate component is introduced. This component will avoid rendering dates on the server for certain (blacklisted) locales.

The background is that a user reported browser JS crashes on the dashboard/My Page. I was able to reproduce them with the Nynorsk (nn) locale, and concluded that there is a bug in Chrome which causes dates to be rendered incorrectly with slashes (/) instead of dots (.) as delimiters.

This causes the output to be rendered differently on the server and client, which causes an instance of the dreaded checksum mismatch React errors.

This workaround will make sure that the error doesn't happen short term. When we are able to use a more recent version of React (in Gen 3) this will no longer be a problem.

See https://github.com/zetkin/zetkin-common/commit/24a8d9cc4a22843200fb1b700486a2dcea960ac5 for details.