Add detection of invalid numbers in opening hours input element
This commit is contained in:
parent
12afdcab75
commit
62f0ae42e0
1 changed files with 5 additions and 1 deletions
|
@ -189,7 +189,11 @@ export class OH {
|
||||||
if(spl.length != 2){
|
if(spl.length != 2){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return {hours: Number(spl[0].trim()), minutes: Number(spl[1].trim())};
|
const hm = {hours: Number(spl[0].trim()), minutes: Number(spl[1].trim())};
|
||||||
|
if(isNaN(hm.hours) || isNaN(hm.minutes) ){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return hm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static parseHHMMRange(hhmmhhmm: string): {
|
public static parseHHMMRange(hhmmhhmm: string): {
|
||||||
|
|
Loading…
Reference in a new issue