mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	strip all delimiters
This commit is contained in:
		| @@ -35,16 +35,14 @@ export class LocalizedDateParserFormatter extends NgbDateParserFormatter { | |||||||
|    * have it expanded to 10.03.2022, in the case of the German format. |    * have it expanded to 10.03.2022, in the case of the German format. | ||||||
|    * (All other formats are also supported) |    * (All other formats are also supported) | ||||||
|    *  |    *  | ||||||
|    * It also replaces commas with the date separator.  |    * It also strips commas or periods before running formatting,  | ||||||
|    * This allows quick entry of the date on the numpad.  |    * which allows quick entry of the date on the numpad.  | ||||||
|    */ |    */ | ||||||
|   private preformatDateInput(value: string): string { |   private preformatDateInput(value: string): string { | ||||||
|     let inputFormat = this.getDateInputFormat() |     let inputFormat = this.getDateInputFormat() | ||||||
|     let dateSeparator = inputFormat.replace(/[dmy]/gi, '').charAt(0) |     let dateSeparator = inputFormat.replace(/[dmy]/gi, '').charAt(0) | ||||||
|  |  | ||||||
|     value = value.replace(/,/g, dateSeparator) |     value = value.replace(/[\/,\.-]/g, '') | ||||||
|  |  | ||||||
|     if (value.includes(dateSeparator)) { return value } |  | ||||||
|  |  | ||||||
|     if (value.length == 4 && inputFormat.substring(0, 4) != 'yyyy') { |     if (value.length == 4 && inputFormat.substring(0, 4) != 'yyyy') { | ||||||
|       return value.substring(0, 2) |       return value.substring(0, 2) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon