forked from Techsystech/web
[IMP] web_timeline: Handle inverted date ranges
Inverted dates make no functional sense, but when they do happen, this change allows displaying them as single points in the timeline (same as when begin=end). We currently do have such demo data when installing project_timeline.17.0
parent
0e325c7126
commit
46697f4382
|
@ -531,9 +531,9 @@ odoo.define("web_timeline.TimelineRenderer", function (require) {
|
||||||
evt: evt,
|
evt: evt,
|
||||||
style: `background-color: ${this.color};`,
|
style: `background-color: ${this.color};`,
|
||||||
};
|
};
|
||||||
// Check if the event is instantaneous,
|
// Only specify range end when there actually is one.
|
||||||
// if so, display it with a point on the timeline (no 'end')
|
// ➔ Instantaneous events / those with inverted dates are displayed as points.
|
||||||
if (date_stop && !moment(date_start).isSame(date_stop)) {
|
if (date_stop && moment(date_start).isBefore(date_stop)) {
|
||||||
r.end = date_stop;
|
r.end = date_stop;
|
||||||
}
|
}
|
||||||
this.color = null;
|
this.color = null;
|
||||||
|
|
Loading…
Reference in New Issue