diff --git a/static/js/base.js b/static/js/base.js index ce86c33..133ef2e 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -219,7 +219,14 @@ function doneLoading (selector) { // Other goodies function formatDate (dateString) { - return (new Date(dateString + ':00')).toLocaleString( + // Replaces the first instance of a space, + // and replace with "T" to fit ISO 8601, + // which all modern browsers support + // Example: YYYY-MM-DD HH:MM:SS-TZ:tz --> YYYY-MM-DDTHH:MM:SS-TZ:tz + // Note: TZ:tz is Hour and Minutes of Time Zone + dateString = `${dateString}:00`.replace(' ', 'T'); + + return (new Date(dateString)).toLocaleString( localizer.locale || 'en-us', { month: 'long', day: 'numeric', year: 'numeric' } );