diff --git a/CHANGELOG.md b/CHANGELOG.md index bca18ba30..b712a620f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ You can also check the [release page](https://github.com/visualize-admin/visuali - Search string is now correctly persisted in search box when refreshing the page (Browse page) - Fixed issue with two queries being sent when refreshing the page when search string was entered (Browse page) - Fixed issue with filtering / unfiltering subthemes that resulted in 404 error (Browse page) + - Dates with timezones are now correctly parsed - Performance - Improved performance of searching for and retrieving datasets (Browse page) - Improved the performance of data download diff --git a/app/formatters.ts b/app/formatters.ts index 6efd49977..37e0077c6 100644 --- a/app/formatters.ts +++ b/app/formatters.ts @@ -100,14 +100,19 @@ export const dateFormatterFromDimension = ( dim.timeUnit.toLowerCase() as keyof typeof localFormatters ]; const parser = timeParse(dim.timeFormat); + const timezoneParser = timeParse(`${dim.timeFormat}%Z`); + return (d: string | null) => { if (!d) { return localFormatters.empty(); } - const parsed = parser(d); + + const parsed = parser(d) ?? timezoneParser(d); + return parsed ? formatter(parsed) : localFormatters.empty(); }; } + return formatDateAuto; };