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

fix(server): correct person birth date across timezones #11369

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

michelheusschen
Copy link
Contributor

The person's birth date is being set to the previous day when the server has a timezone with a negative UTC offset. Fixes #11354 by keeping birthDate as a string instead of converting it to a Date.

Testing this is difficult, because there doesn't seem to be a way to set the timezone during tests.

@@ -185,13 +194,13 @@ describe('/people', () => {
.set('Authorization', `Bearer ${admin.accessToken}`)
.send({
name: 'New Person',
birthDate: '1990-01-01T05:00:00.000Z',
birthDate: '1990-01-01',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if dates with a time should be accepted. I've removed the time part for now.

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrasm91 jrasm91 merged commit 434bcec into main Jul 29, 2024
22 checks passed
@jrasm91 jrasm91 deleted the fix/person-birth-date-across-timezones branch July 29, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Date of birth in set incorrectly
3 participants