Incorrect date of birth saved in certain timezones.
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: | added: patron |
I apologize, that patch has a mistake. This should be correct.