[FIX] Calendar month view does not show events starting in previous month. bug-1163912
authorChristophe Matthieu <chm@openerp.com>
Fri, 28 Jun 2013 09:07:06 +0000 (11:07 +0200)
committerChristophe Matthieu <chm@openerp.com>
Fri, 28 Jun 2013 09:07:06 +0000 (11:07 +0200)
bzr revid: chm@openerp.com-20130628090706-ztqfodf5xxi2201j

addons/web_calendar/static/src/js/calendar.js

index 8da2ad4..9d6ce68 100644 (file)
@@ -395,10 +395,16 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
         });
     },
     get_range_domain: function() {
-        var format = instance.web.date_to_str,
-            domain = this.last_search[0].slice(0);
-        domain.unshift([this.date_start, '>=', format(this.range_start.clone().addDays(-6))]);
-        domain.unshift([this.date_start, '<=', format(this.range_stop.clone().addDays(6))]);
+        var format = instance.web.date_to_str;
+        var A = format(this.range_start.clone().addDays(-6));
+        var B = format(this.range_stop.clone().addDays(6));
+        var domain = [
+            '|', '|',
+            '&', [this.date_start, '>=', A], [this.date_start, '<=', B],
+            '&', [this.date_stop, '>=', A], [this.date_stop, '<=', B],
+            '&', [this.date_start, '<', A], [this.date_stop, '>', B]
+        ];
+        domain.concat(this.last_search[0].slice(0))
         return domain;
     },
     do_show: function () {