Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] web: date field in calendar no tz issue #32796

Closed
wants to merge 1 commit into from

Conversation

nle-odoo
Copy link
Contributor

@nle-odoo nle-odoo commented Apr 18, 2019

The calendar should send to server:

  • for an all day event (all_day field on view): the date in UTC (ie. if
    we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00)
  • for a datetime event not all day: the UTC datetime corresponding to
    UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before)
  • for a date event: the date in UTC (ie. same as all day)

The current code was alright for datetime, but there was a missing case
if the start_date was a Date field and not a Datetime field that is
fixed with this changeset.

opw-1969876
opw-1971106
opw-1971019

@nle-odoo nle-odoo added the OE the report is linked to a support ticket (opw-...) label Apr 18, 2019
@robodoo robodoo added seen 🙂 CI 🤖 Robodoo has seen passing statuses labels Apr 18, 2019
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Apr 23, 2019
@nle-odoo nle-odoo requested a review from adr-odoo April 23, 2019 12:03
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Apr 23, 2019
},
session: {
getTZOffset: function () {
return -2400; // 40 hours timezone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't represent reality...

Copy link
Contributor Author

@nle-odoo nle-odoo Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 120 (2 hours) so without the test fail with [day before expected days] 22:00:00 instead of with the fix: [expected day] 00:00:00

@adr-odoo
Copy link
Contributor

  • Add why this bug didn't occured before (link your previous fix).
  • This bug only occured for tasks only because we have datetime in event.
  • opw-196987 ??

@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Apr 24, 2019
@nle-odoo
Copy link
Contributor Author

thanks updated, the commit in 6228829b5ccc1

and the missing number on opw was a typo, this was opw-1969876 and commit message has been updated

The calendar should send to server:

- for an all day event (all_day field on view): the date in UTC (ie. if
we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00)
- for a datetime event not all day: the UTC datetime corresponding to
UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before)
- for a date event: the date in UTC (ie. same as all day)

The current code was alright for datetime, but there was a missing case
if the start_date was a Date field (eg. project task calendar view uses
a date_deadline Date field) and not a Datetime field.

This changeset apply the same behavior as an all_day event to a calendar
with a start date that is a Date field.

Note: the issue happen since 11.0's 03d74f4 (26th march 2019) that
solved a similar case but for datetime (a datetime event at 8:00 with
timezone UTC+9 would be moved the previous day when drag and dropped on
the month view).

opw-1969876
opw-1971106
opw-1971019
closes odoo#32796
@adr-odoo adr-odoo self-requested a review April 24, 2019 09:59
Copy link
Contributor

@adr-odoo adr-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robodoo robodoo added r+ 👌 CI 🤖 Robodoo has seen passing statuses labels Apr 24, 2019
robodoo pushed a commit that referenced this pull request Apr 24, 2019
The calendar should send to server:

- for an all day event (all_day field on view): the date in UTC (ie. if
we are on 22 august 2018 on UTC+2, not send 21 august 2018 22:00)
- for a datetime event not all day: the UTC datetime corresponding to
UTC (for 03:25 with UTC+5 timezone, we send 22:25 the day before)
- for a date event: the date in UTC (ie. same as all day)

The current code was alright for datetime, but there was a missing case
if the start_date was a Date field (eg. project task calendar view uses
a date_deadline Date field) and not a Datetime field.

This changeset apply the same behavior as an all_day event to a calendar
with a start date that is a Date field.

Note: the issue happen since 11.0's 03d74f4 (26th march 2019) that
solved a similar case but for datetime (a datetime event at 8:00 with
timezone UTC+9 would be moved the previous day when drag and dropped on
the month view).

opw-1969876
opw-1971106
opw-1971019
closes #32796

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
@robodoo
Copy link
Contributor

robodoo commented Apr 24, 2019

Merged, thanks!

@robodoo robodoo closed this Apr 24, 2019
@adr-odoo adr-odoo deleted the 11.0-web-opw-196987-nle branch April 24, 2019 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants