Skip to content

Commit dda6153

Browse files
[O2B-1578] Change timeRange filters to only trigger filters when both time and date have been filled in (#2130)
Notable changes for users: - Overview pages will no longer keep reloading whilst they're filling time range filters Notable changes for developers: - DateTimeInputModel will only notify its observers if both time and date are provided during an update - Removed superfluous argument which was not required by method
1 parent f5ffe24 commit dda6153

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/public/components/common/form/inputs/DateTimeInputModel.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ export class DateTimeInputModel extends Observable {
6565
*/
6666
update(raw) {
6767
this._raw = raw;
68+
const hasDateAndTime = raw.date && raw.time;
69+
6870
try {
69-
this._value = raw.date && raw.time ? extractTimestampFromDateTimeInput(raw, { seconds: this._seconds }) : null;
71+
this._value = hasDateAndTime ? extractTimestampFromDateTimeInput(raw) : null;
7072
} catch {
7173
this._value = null;
7274
}
7375

74-
this.notify();
76+
hasDateAndTime && this.notify();
7577
}
7678

7779
/**

0 commit comments

Comments
 (0)