A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
retain document time / tz in detail form
Michael Shamoon784982718ef3
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.tsindex 4767a2495..f6fdc1b86 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.ts+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts@@ -87,6 +87,8 @@ export class DocumentDetailComponentrequiresPassword: boolean = falsepassword: string+ ogDate: Date+@ViewChild('nav') nav: NgbNav@ViewChild('pdfPreview') set pdfPreview(element) {// this gets called when compontent added or removed from DOM@@ -142,7 +144,21 @@ export class DocumentDetailComponentngOnInit(): void {this.documentForm.valueChanges.pipe(takeUntil(this.unsubscribeNotifier))- .subscribe((wow) => {+ .subscribe((changes) => {+ if (this.ogDate) {+ let newDate = new Date(changes['created'])+ newDate.setHours(+ this.ogDate.getHours(),+ this.ogDate.getMinutes(),+ this.ogDate.getSeconds(),+ this.ogDate.getMilliseconds()+ )+ this.documentForm.patchValue(+ { created: this.formatDate(newDate) },+ { emitEvent: false }+ )+ }+Object.assign(this.document, this.documentForm.value)})@@ -183,17 +199,25 @@ export class DocumentDetailComponentthis.updateComponent(doc)}+ this.ogDate = new Date(doc.created)+// Initialize dirtyCheckthis.store = new BehaviorSubject({title: doc.title,content: doc.content,- created: doc.created,+ created: this.formatDate(this.ogDate),correspondent: doc.correspondent,document_type: doc.document_type,archive_serial_number: doc.archive_serial_number,tags: [...doc.tags],})+ // ensure we're always starting with 24-char ISO8601 string+ this.documentForm.patchValue(+ { created: this.formatDate(this.ogDate) },+ { emitEvent: false }+ )+this.isDirty$ = dirtyCheck(this.documentForm,this.store.asObservable()@@ -461,4 +485,8 @@ export class DocumentDetailComponentthis.password = (event.target as HTMLInputElement).value}}++ formatDate(date: Date): string {+ return date.toISOString().split('.')[0] + 'Z'+ }}