Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

fixes an issue with the date dropdowns

jonaswinkler28f45d8f159d
diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
index 806027f9c..91402d084 100644
--- a/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
+++ b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
@@ -1,7 +1,6 @@
import { Component, EventEmitter, Input, Output, ElementRef, ViewChild, SimpleChange } from '@angular/core';
import { NgbDate, NgbDateStruct, NgbDatepicker } from '@ng-bootstrap/ng-bootstrap';
-
export interface DateSelection {
before?: NgbDateStruct
after?: NgbDateStruct
@@ -72,7 +71,6 @@ export class FilterDropdownDateComponent {
}
setDateQuickFilter(range: any) {
- this._dateAfter = this._dateBefore = undefined
let date = new Date()
let newDate: NgbDateStruct = { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() }
switch (typeof range) {
@@ -92,18 +90,23 @@ export class FilterDropdownDateComponent {
break
}
this._dateAfter = newDate
+ this._dateBefore = null
this.datesSet.emit({after: newDate, before: null})
}
onBeforeSelected(date: NgbDateStruct) {
+ this._dateBefore = date
this.datesSet.emit({after: this._dateAfter, before: date})
}
onAfterSelected(date: NgbDateStruct) {
+ this._dateAfter = date
this.datesSet.emit({after: date, before: this._dateBefore})
}
clear() {
+ this._dateBefore = null
+ this._dateAfter = null
this.datesSet.emit({after: null, before: null})
}
}