mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	simplify date value format
This commit is contained in:
		| @@ -53,17 +53,11 @@ export class DateComponent | ||||
|   } | ||||
|  | ||||
|   onSuggestionClick(dateString: string) { | ||||
|     const parsedNgDate = this.ngbDateParserFormatter.parse(dateString) | ||||
|     this.writeValue(this.formatDateAsYYYYMMDD(parsedNgDate)) | ||||
|     const parsedDate = this.ngbDateParserFormatter.parse(dateString) | ||||
|     this.writeValue(`${parsedDate.year}-${parsedDate.month}-${parsedDate.day}`) | ||||
|     this.onChange(this.value) | ||||
|   } | ||||
|  | ||||
|   formatDateAsYYYYMMDD(date: NgbDateStruct) { | ||||
|     const monthPrefix = date.month > 9 ? '' : '0' | ||||
|     const dayPrefix = date.day > 9 ? '' : '0' | ||||
|     return `${date.year}-${monthPrefix}${date.month}-${dayPrefix}${date.day}` | ||||
|   } | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     super.ngOnInit() | ||||
|     this.placeholder = this.settings.getLocalizedDateInputFormat() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon