Incorrect date of birth saved in certain timezones.

Bug #1828114 reported by Dan Briem
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

When registering or editing a patron in the web staff client, regctrl.js converts the date of birth string to a Date object for the datepicker. This adds time information, 00:00:00 in the local time zone. Before saving, the date of birth converts back to a string using toISOString() and lops off the time info. But the function converts to UTC first, so if the timezone is past UTC it subtracts the offset from time 00:00:00, and the resulting string is the previous date, which then saves in the database.

I'm not sure how many people this would actually affect or if this is any kind of priority, but I attached a patch that formats the string using momentjs instead, so there's no time zone conversion.

Tags: patron
Revision history for this message
Dan Briem (dbriem) wrote :
Revision history for this message
Dan Briem (dbriem) wrote :

I apologize, that patch has a mistake. This should be correct.

tags: added: patron
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.