Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexStatsView: fix "invalid date" error #854

Merged
merged 1 commit into from
May 6, 2024

Conversation

schu
Copy link
Member

@schu schu commented May 2, 2024

The stats graph on the index page shows hourly answer and user counts on hover. Though with Safari the label doesn't show the datetime but an error message "invalid date". This is because the datetime string as received from the API doesn't adhere to a standard datetime format (by default, datetime fields are stored as UTC in the format 2018-01-01 00:00:00).

Update the scheduled stats routine to send datetime keys in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601) and update the frontend code to use date-fns's parseISO to parse the date from the label context for the local time zone.

Also, change the index stats graph to show at most 4 ticks on the y-axis.

Resolves #853

@schu schu changed the title IndexStatusView: fix "invalid date" error IndexStatsView: fix "invalid date" error May 2, 2024
@schu schu force-pushed the schu/safari-fix-invalid-date branch from fa47f1a to 46b6520 Compare May 2, 2024 17:49
The stats graph on the index page shows hourly answer and user counts on
hover. Though with Safari the label doesn't show the datetime but an
error message "invalid date". This is because the datetime string as
received from the API doesn't adhere to a standard datetime format (by
default, datetime fields are stored as UTC in the format
`2018-01-01 00:00:00`).

Update the scheduled stats routine to send datetime keys in ISO 8601
format (https://en.wikipedia.org/wiki/ISO_8601) and update the frontend
code to use date-fns's `parseISO` to parse the date from the label
context for the local time zone.

Also, change the index stats graph to show at most 4 ticks on the
y-axis.

Resolves #853
@schu schu force-pushed the schu/safari-fix-invalid-date branch from 46b6520 to 66bc531 Compare May 6, 2024 09:36
@schu schu merged commit 6f5d918 into master May 6, 2024
1 check passed
@schu schu deleted the schu/safari-fix-invalid-date branch May 6, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index stats graph dates not working with Safari
1 participant