Commit b8a78a07 authored by christoph.kopp's avatar christoph.kopp
Browse files

Fixed: bug OXUIB-741L3 wrong date in filter rule, previous day

(cherry picked from commit 8fa8fb11)
parent 71e7ab64
Pipeline #150604 passed with stages
in 39 minutes and 38 seconds
......@@ -182,6 +182,10 @@ define('io.ox/backbone/mini-views/datepicker', [
return this;
},
getFallback: function () {
return this.model.get('zone') ? 'UTC' : moment().tz();
},
updateView: function () {
var timestamp;
if (!this.chronos) {
......@@ -192,7 +196,7 @@ define('io.ox/backbone/mini-views/datepicker', [
}
timestamp = parseInt(this.model.getDate ? this.model.getDate(this.attribute, { fulltime: this.isFullTime() }) : this.model.get(this.attribute), 10);
if (_.isNaN(timestamp)) return;
timestamp = moment.tz(timestamp, this.model.get(this.options.timezoneAttribute) || moment().tz());
timestamp = moment.tz(timestamp, this.model.get(this.options.timezoneAttribute) || this.getFallback());
} else {
timestamp = this.model.getMoment(this.attribute);
}
......@@ -268,7 +272,7 @@ define('io.ox/backbone/mini-views/datepicker', [
}
// parse string to timestamp
var parsedDate = moment.tz(dateStr, formatStr, this.chronos ? this.model.get(this.attribute).tzid || moment().tz() : this.model.get(this.options.timezoneAttribute) || moment().tz());
var parsedDate = moment.tz(dateStr, formatStr, this.chronos ? this.model.get(this.attribute).tzid || moment().tz() : this.model.get(this.options.timezoneAttribute) || this.getFallback());
if (this.chronos) {
if (this.isFullTime()) return { value: parsedDate.format('YYYYMMDD') };
return { value: parsedDate.format('YYYYMMDD[T]HHmmss'), tzid: this.model.get(this.attribute).tzid || moment().tz() };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment