Bug #6293
closed
Issue appears to be with Moment incorrectly formatting the datetime.
- 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.
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).
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.
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF