A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Make date suggestions timezone-unaware
Michael Shamoon7e2c693c8afe
diff --git a/src-ui/src/app/components/common/input/date/date.component.ts b/src-ui/src/app/components/common/input/date/date.component.tsindex 63a15709b..76bfd08d0 100644--- a/src-ui/src/app/components/common/input/date/date.component.ts+++ b/src-ui/src/app/components/common/input/date/date.component.ts@@ -1,8 +1,8 @@import { Component, forwardRef, Input, OnInit } from '@angular/core'import { NG_VALUE_ACCESSOR } from '@angular/forms'import {+ NgbDateAdapter,NgbDateParserFormatter,- NgbDateStruct,} from '@ng-bootstrap/ng-bootstrap'import { SettingsService } from 'src/app/services/settings.service'import { AbstractInputComponent } from '../abstract-input'@@ -25,36 +25,31 @@ export class DateComponent{constructor(private settings: SettingsService,- private ngbDateParserFormatter: NgbDateParserFormatter+ private ngbDateParserFormatter: NgbDateParserFormatter,+ private isoDateAdapter: NgbDateAdapter<string>) {super()}@Input()- suggestions: Date[]+ suggestions: string[]getSuggestions() {- if (this.suggestions == null) return []-- return this.suggestions- .map((s) => new Date(s)) // required to call the date functions below- .filter(- (d) =>- this.value === null || // if value is not set, take all suggestions- d.toISOString().slice(0, 10) != this.value // otherwise filter out the current value- )- .map((s) =>- this.ngbDateParserFormatter.format({- year: s.getFullYear(),- month: s.getMonth() + 1, // month of Date is zero based- day: s.getDate(),- })- )+ return this.suggestions == null+ ? []+ : this.suggestions+ .map((s) => this.ngbDateParserFormatter.parse(s))+ .filter(+ (d) =>+ this.value === null || // if value is not set, take all suggestions+ this.value != this.isoDateAdapter.toModel(d) // otherwise filter out current date+ )+ .map((s) => this.ngbDateParserFormatter.format(s))}onSuggestionClick(dateString: string) {const parsedDate = this.ngbDateParserFormatter.parse(dateString)- this.writeValue(`${parsedDate.year}-${parsedDate.month}-${parsedDate.day}`)+ this.writeValue(this.isoDateAdapter.toModel(parsedDate))this.onChange(this.value)}diff --git a/src-ui/src/app/data/paperless-document-suggestions.ts b/src-ui/src/app/data/paperless-document-suggestions.tsindex 9f976d71b..295a1ab0e 100644--- a/src-ui/src/app/data/paperless-document-suggestions.ts+++ b/src-ui/src/app/data/paperless-document-suggestions.ts@@ -7,5 +7,5 @@ export interface PaperlessDocumentSuggestions {storage_paths?: number[]- dates?: Date[]+ dates?: string[] // ISO-formatted date string e.g. 2022-11-03}