mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
fixes an issue with the date dropdowns
This commit is contained in:
parent
8e339789fa
commit
28f45d8f15
@ -1,7 +1,6 @@
|
|||||||
import { Component, EventEmitter, Input, Output, ElementRef, ViewChild, SimpleChange } from '@angular/core';
|
import { Component, EventEmitter, Input, Output, ElementRef, ViewChild, SimpleChange } from '@angular/core';
|
||||||
import { NgbDate, NgbDateStruct, NgbDatepicker } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbDate, NgbDateStruct, NgbDatepicker } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
|
|
||||||
export interface DateSelection {
|
export interface DateSelection {
|
||||||
before?: NgbDateStruct
|
before?: NgbDateStruct
|
||||||
after?: NgbDateStruct
|
after?: NgbDateStruct
|
||||||
@ -72,7 +71,6 @@ export class FilterDropdownDateComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDateQuickFilter(range: any) {
|
setDateQuickFilter(range: any) {
|
||||||
this._dateAfter = this._dateBefore = undefined
|
|
||||||
let date = new Date()
|
let date = new Date()
|
||||||
let newDate: NgbDateStruct = { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() }
|
let newDate: NgbDateStruct = { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() }
|
||||||
switch (typeof range) {
|
switch (typeof range) {
|
||||||
@ -92,18 +90,23 @@ export class FilterDropdownDateComponent {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
this._dateAfter = newDate
|
this._dateAfter = newDate
|
||||||
|
this._dateBefore = null
|
||||||
this.datesSet.emit({after: newDate, before: null})
|
this.datesSet.emit({after: newDate, before: null})
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeSelected(date: NgbDateStruct) {
|
onBeforeSelected(date: NgbDateStruct) {
|
||||||
|
this._dateBefore = date
|
||||||
this.datesSet.emit({after: this._dateAfter, before: date})
|
this.datesSet.emit({after: this._dateAfter, before: date})
|
||||||
}
|
}
|
||||||
|
|
||||||
onAfterSelected(date: NgbDateStruct) {
|
onAfterSelected(date: NgbDateStruct) {
|
||||||
|
this._dateAfter = date
|
||||||
this.datesSet.emit({after: date, before: this._dateBefore})
|
this.datesSet.emit({after: date, before: this._dateBefore})
|
||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
|
this._dateBefore = null
|
||||||
|
this._dateAfter = null
|
||||||
this.datesSet.emit({after: null, before: null})
|
this.datesSet.emit({after: null, before: null})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user