mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-20 10:01:19 +00:00
Limit date input field chars and length
This commit is contained in:
@@ -40,4 +40,11 @@ export class DateComponent extends AbstractInputComponent<string> implements OnI
|
||||
this.value = dateFormatter.preformatDateInput(valArr.join(''))
|
||||
}
|
||||
}
|
||||
|
||||
// prevent chars other than numbers and separators
|
||||
onKeyPress(event: KeyboardEvent) {
|
||||
if (!/[0-9,\.\/-]+/.test(event.key)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user