mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Limit date input field chars and length
This commit is contained in:
parent
af7ffa3878
commit
a1fd9f7310
4 changed files with 20 additions and 6 deletions
|
|
@ -140,4 +140,10 @@ export class DateDropdownComponent implements OnInit, OnDestroy {
|
|||
this.onChange()
|
||||
}
|
||||
|
||||
// prevent chars other than numbers and separators
|
||||
onKeyPress(event: KeyboardEvent) {
|
||||
if (!/[0-9,\.\/-]+/.test(event.key)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue