[FIX] web: incorrect date in calendar

- Set the OS timezone to GMT-6
- Create a project task with a date deadline on D day
- The tasks appears at D-1 in the calendar

This was supposed to be fixed with 0c0fb63b0d, but actually no.

opw-1815446
opw-1828130
This commit is contained in:
Nicolas Martinelli
2018-03-26 09:02:36 +02:00
committed by Nicolas Martinelli
parent 14e69ca5f1
commit cafc6c3ae0
2 changed files with 11 additions and 5 deletions
@@ -611,7 +611,8 @@ return AbstractModel.extend({
var date_start;
var date_stop;
var date_delay = evt[this.mapping.date_delay] || 1.0,
all_day = this.mapping.all_day ? evt[this.mapping.all_day] : false,
all_day = this.fields[this.mapping.date_start].type === 'date' ||
this.mapping.all_day && evt[this.mapping.all_day] || false,
the_title = '',
attendees = [];
@@ -635,8 +636,6 @@ return AbstractModel.extend({
if (this.mapping.all_day && evt[this.mapping.all_day]) {
date_stop.add(1, 'days');
}
var isAllDay = this.fields[this.mapping.date_start].type === 'date' ||
this.mapping.all_day && evt[this.mapping.all_day] || false;
var r = {
'record': evt,
'start': date_start,
@@ -644,7 +643,7 @@ return AbstractModel.extend({
'r_start': date_start,
'r_end': date_stop,
'title': the_title,
'allDay': isAllDay,
'allDay': all_day,
'id': evt.id,
'attendees':attendees,
};
@@ -1571,7 +1571,7 @@ QUnit.module('Views', {
});
QUnit.test('set event as all day when field is date', function (assert) {
assert.expect(1);
assert.expect(2);
this.data.event.records[0].start_date = "2016-12-14";
@@ -1595,9 +1595,16 @@ QUnit.module('Views', {
viewOptions: {
initialDate: initialDate,
},
session: {
getTZOffset: function () {
return -480;
}
},
});
assert.strictEqual(calendar.$('.fc-day-grid .fc-event-container').length, 1,
"should be one event in the all day row");
assert.strictEqual(calendar.model.data.data[0].r_start.date(), 14,
"the date should be 14");
calendar.destroy();
});