Bug #6293
closedCalendar only usage with time incorrectly sets time in hidden input
Description
When using popup calendar only usage it causes the time added to the hidden input to be incorrect.
Updated by krileon about 8 years ago
Issue appears to be with Moment incorrectly formatting the datetime.
Updated by krileon about 8 years ago
- Priority changed from High to Immediate
This is a deeper issue. Current usage is not properly converting local to UTC. The user should ALWAYS be selecting a datetime as local. It should then ALWAYS be converted to UTC for storage. Currently it is converting to UTC offset then stored. This causes re-display to always be wrong since it's UTC offset that is being offset.
Updated by krileon about 8 years ago
The selection should be based off the offset sent to jQuery. So if the user has America/Los_Angeles selected that's a -8 offset. This means their selection should be assumed in that timezone and it should offset from that timezone since that's what is going to happen with PHP (it'll offset UTC to America/Los_Angeles since that is what is set for the users timezone).
Updated by krileon about 8 years ago
Looks like Moment does not like the offset to change after the fact. So when the moment object is constructed it's done so with local offset. Then the offset is changed and it wants to offset from the already offset value even if forced back to UTC. So the moment object needs to have the offset appended at time of construct then converted to UTC and it'll be 100% accurate.
Updated by krileon about 8 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
Fixed in MR !1160