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

Interfaz displaying an incorrect date in related resource tab #298

Closed
EstebanMH-SiB opened this issue Oct 3, 2024 · 3 comments
Closed
Labels
Type: Bug Something isn't working

Comments

@EstebanMH-SiB
Copy link

There looks to be a mismatch in date displayed when I look in our hosted portal in related resources tab. In this record of Cryptotis thomasi it showns 11 may for the related occurrence:
Image

And it looks weird considering that they are supposed to be clustered because they have some equal information.

But when I look for that occurrence in GBIF it shows 12 of may: https://gbif.org/occurrence/3710474697
Image

And it is shown correctly in occurrence search in GBIF Image

No idea why it is showing some dates mismatched by one day, but other records were behaving similarly.

Thanks in advance,

@MortenHofft
Copy link
Member

MortenHofft commented Oct 4, 2024

I haven't looked yet, but I'm 99% sure it is because it is using the browsers timezone when formatting the date. I probably didn't properly specify that it should use UTC. And dates used to include the timezone, but after a change within the last year in how we handle dates, precision and ranges, then the timezone Z is not longer included in the date string. And so the formatting falls back to using local time.

May I ask what operating system (windows/mac), browser(chrome,safari,firefox,internet explorer7) and browser version you are using? The library we are using depends on the browser being able to understand timezones.

@MortenHofft MortenHofft added the Type: Bug Something isn't working label Oct 4, 2024
@MortenHofft
Copy link
Member

I've looked and annoyingly I do not really get it. The first time shows correctly with hours. And the second that only has date resolution shows the wrong date. Neither of them has a time zone specified. So I would have expected the browser to handle them the same.

Anyhow, I've tried to be more explicit and add Z when not specified to the interpretation. And then similarly define it as UTC when displayed. That should hopefully fix it. Could you please check the behaviour in staging?

@EstebanMH-SiB
Copy link
Author

Thanks! Now it is working on staging Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants