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

Dates stored for the record (DoB...) are shown incorrectly if you are in a negative offset timezone #6719

Closed
3 of 4 tasks
rikukissa opened this issue Apr 3, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@rikukissa
Copy link
Collaborator

rikukissa commented Apr 3, 2024

Describe the bug
Root cause is storing dates without timezone, interpreting them as UTC times and rendering as local time.
Affects any country with a negative timezone offset. Are the raw dates exposed to the certificate? If yes, then we could deprecate dateFormatTransformer altogether and add a new formatting helpers in country configuration for dates without and with a timezone.

Id imagine local time of the event is what is shown on birth certificates in most cases at least. longDateTransformer is probably unaffected

There is a discrepancy in dateTime fields that it returns the number of milliseconds elapsed since epoch to the custom handlebars while our eventDate handlebars get the formatted string. Could we address that here as well perhaps?

Tasks

  • Define a new GraphQL scalar and a graphql-codegen type PlainDate

    • PlainDate needs to be a type that cannot be directly used as new Date parameter so compiler lets you know
  • Implement a method for converting PlainDates to regular Dates so the time is converted properly to a Date

new Date(plainDate) -> UTC date -> UTC date -11 hours = wrong date

localToUTC(plainDate) -> UTC date + (your timezone offset * -1) -> UTC date + 11 hours
localToUTC(plainDate) -> UTC date - 11 -> UTC date
  • Verify values are shown correctly in the UI when your browser is on a -11 time zone
  • Is this a breaking change and what's the implication?
@rikukissa rikukissa added the Bug label Apr 3, 2024
@Zangetsu101 Zangetsu101 self-assigned this Apr 3, 2024
@Zangetsu101 Zangetsu101 added this to the 1.4.2 milestone Apr 3, 2024
@SyedaAfrida
Copy link
Collaborator

This bug is fixed

Loom.Message.-.15.April.2024.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants