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

Projects
None yet
3 participants
@nle-odoo
Copy link
Contributor

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 label Apr 18, 2019

@nle-odoo nle-odoo force-pushed the odoo-dev:11.0-web-opw-196987-nle branch from 16a2baa to 0759e1a Apr 18, 2019

nle-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 18, 2019

[FIX] web: date field in calendar no tz issue
WIP: working on a test

opw-196987
closes odoo#32796

@nle-odoo nle-odoo force-pushed the odoo-dev:11.0-web-opw-196987-nle branch from 0759e1a to 97c5191 Apr 23, 2019

nle-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 23, 2019

[FIX] web: date field in calendar no tz issue
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-196987
opw-1971106
opw-1971019
closes odoo#32796

@robodoo robodoo removed the CI 🤖 label Apr 23, 2019

@nle-odoo nle-odoo requested a review from adr-odoo Apr 23, 2019

@robodoo robodoo added the CI 🤖 label Apr 23, 2019

},
session: {
getTZOffset: function () {
return -2400; // 40 hours timezone

This comment has been minimized.

Copy link
@adr-odoo

adr-odoo Apr 24, 2019

Contributor

It doesn't represent reality...

This comment has been minimized.

Copy link
@nle-odoo

nle-odoo Apr 24, 2019

Author Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

  • 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 ??

@nle-odoo nle-odoo force-pushed the odoo-dev:11.0-web-opw-196987-nle branch from 97c5191 to 6228829 Apr 24, 2019

nle-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 24, 2019

[FIX] web: date field in calendar no tz issue
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.

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

@robodoo robodoo removed the CI 🤖 label Apr 24, 2019

@nle-odoo

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

thanks updated, the commit in 6228829

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

[FIX] web: date field in calendar no tz issue
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

@nle-odoo nle-odoo force-pushed the odoo-dev:11.0-web-opw-196987-nle branch from 6228829 to 011998d Apr 24, 2019

@adr-odoo adr-odoo self-requested a review Apr 24, 2019

@adr-odoo
Copy link
Contributor

left a comment

robodoo pushed a commit that referenced this pull request Apr 24, 2019

[FIX] web: date field in calendar no tz issue
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

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

Merged, thanks!

@robodoo robodoo closed this Apr 24, 2019

@adr-odoo adr-odoo deleted the odoo-dev:11.0-web-opw-196987-nle branch Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.