From 3dca9539806ba19c7085ce03cade0cf526b82e7d Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Fri, 29 Sep 2023 21:46:45 -0600 Subject: [PATCH] Added ECMAScript Internationalization API support -Most modern browsers already have ECMAScript Internationalization API support built-in, but many older browsers do not. For these unsupported browsers, Luxon would fail to load the formatted dates on many of the explorer pages which would cause a cascading effect of not loading other data leading to a broken experience. A polyfilled version of Intl.js is now being loaded into the site which will only be downloaded when using a browser that does not already have Internationalization API support --- README.md | 1 + views/includes/common.pug | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 07570f0..6b41191 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ Table of Contents - chartjs-plugin-crosshair v1.2.0 ([https://github.com/abelheinsbroek/chartjs-plugin-crosshair](https://github.com/abelheinsbroek/chartjs-plugin-crosshair)) - OverlayScrollbars v1.13.3 - flag-icon-css v4.1.4 ([https://github.com/lipis/flag-icon-css](https://github.com/lipis/flag-icon-css)) + - Intl.js (uses the v3.111.0 polyfill service to only download if using a browser that doesn't already support the ECMAScript Internationalization API) - Platform independent (tested to run on Windows, MacOS and Linux) **NOTE:** Most of the instructions in this guide were written for use with Linux and may need to be modified when using another OS - Mobile-friendly - Sass support diff --git a/views/includes/common.pug b/views/includes/common.pug index 07df85f..db52276 100644 --- a/views/includes/common.pug +++ b/views/includes/common.pug @@ -1,3 +1,4 @@ +script(type='text/javascript', src='https://polyfill.io/v3/polyfill.min.js?version=3.111.0&features=Intl') script(type='text/javascript', src='https://cdn.jsdelivr.net/npm/luxon@2.1.1/build/global/luxon.min.js') script. function format_unixtime(unixtime, alt) {