Project

General

Profile

Actions

Bug #6293

closed

Calendar only usage with time incorrectly sets time in hidden input

Added by krileon about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Target version:
Start date:
08 November 2016
Due date:
% Done:

100%

Estimated time:

Description

When using popup calendar only usage it causes the time added to the hidden input to be incorrect.

https://www.joomlapolis.com/forum/153-professional-member-support/232741-failed-to-parse-time-string-when-scheduling-an-event-in-groupjive#287693

Actions #1

Updated by krileon about 8 years ago

Issue appears to be with Moment incorrectly formatting the datetime.

Actions #2

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.

Actions #3

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).

Actions #4

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.

Actions #5

Updated by krileon about 8 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Fixed in MR !1160

Actions #6

Updated by krileon about 8 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF