Skip to content

Commit

Permalink
fix: ambulance registration validation, year limit
Browse files Browse the repository at this point in the history
  • Loading branch information
SandeepThomas committed Mar 24, 2020
1 parent 51b1877 commit 4b5c463
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Components/Ambulance/VehicleDetailsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ export const VehicleDetailsForm = (props: any) => {
}];
for(let i=0;i<=2;i++){
let text = `202${i}`
if(i==2){
text=`2022`
}
validTill.push({id:text,text})
}

Expand Down Expand Up @@ -76,7 +73,7 @@ export const VehicleDetailsForm = (props: any) => {
case "registrationNumber":
if (!value) {
err[key] = "This field is required";
}else if(value && !(/^[A-Z]{2}[0-9]{1,2}[A-Z]{1,2}[0-9]{1,4}$/.test(value))){
}else if(value && !(/^[a-zA-Z]{2}[0-9]{1,2}[a-zA-Z]{1,2}[0-9]{1,4}$/.test(value))){
err[key] = "Invalid vehicle number";
}
break;
Expand Down

0 comments on commit 4b5c463

Please sign in to comment.