Skip to content

Commit

Permalink
[FIX] website_event_snippet_calendar: Display event timezone
Browse files Browse the repository at this point in the history
Before this patch, the user was getting the Public User's TZ on the
calendar view.

After merged, only the event's timzeone will be used to display dates.

It is, however, affected by odoo/odoo#27179,
which means that there is a possible mismatch between the date used
to search and the one used to display, most likely to be hit when
events have very different timzeones. Added to Known Issues.
  • Loading branch information
yajo authored and Tardo committed May 13, 2019
1 parent 1ebc993 commit e34ee98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions website_event_snippet_calendar/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Known issues / Roadmap
======================

* Remove ``bootstrap-datetimepicker`` bundled library when migrating to v11.
* Do not rely on ``date_begin_located`` field in v11+, because implementation
has changed, and it returns a human-readable format instead of a
machine-parseable one.
* This addon is affected by https://github.com/odoo/odoo/issues/27179 like
Odoo itself. It should get the same fix as upstream when it lands.

Bug Tracker
===========
Expand Down
2 changes: 1 addition & 1 deletion website_event_snippet_calendar/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Event Calendar and List Snippet and Iframe",
"summary": "Browsable calendar with events list for your website",
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"category": "Website",
"website": "https://github.com/OCA/event",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
3 changes: 2 additions & 1 deletion website_event_snippet_calendar/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def events_for_day(self, day=None, limit=None):
domain=domain,
limit=limit,
fields=[
"date_begin",
# TODO Use a v10-like field in v11+
"date_begin_located",
"name",
"event_type_id",
"website_published",
Expand Down
2 changes: 1 addition & 1 deletion website_event_snippet_calendar/static/src/js/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ odoo.define('website_event_snippet_calendar.animation', function (require) {
},
_render_list: function (events) {
_.each(events, function (element) {
element.date_begin = moment(element.date_begin)
element.date_begin = moment(element.date_begin_located)
.format(this.date_format);
}, this);
this.$list.html(core.qweb.render(
Expand Down

0 comments on commit e34ee98

Please sign in to comment.