fixed bug with uk zip code and add retrieved timestamp for dewars at the beamline
This commit is contained in:
@ -78,7 +78,11 @@ const ShipmentForm: React.FC<ShipmentFormProps> = ({ sx = {}, onCancel, refreshS
|
||||
|
||||
const validateEmail = (email: string) => /\S+@\S+\.\S+/.test(email);
|
||||
const validatePhoneNumber = (phone: string) => /^\+?[1-9]\d{1,14}$/.test(phone);
|
||||
const validateZipCode = (zipcode: string) => /^\d{5}(?:[-\s]\d{4})?$/.test(zipcode);
|
||||
const validateZipCode = (zipcode: string) => {
|
||||
const usZipCodeRegex = /^\d{4,5}(?:[-\s]\d{4})?$/;
|
||||
const ukPostCodeRegex = /^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$/i;
|
||||
return usZipCodeRegex.test(zipcode) || ukPostCodeRegex.test(zipcode);
|
||||
};
|
||||
|
||||
const isContactFormValid = () => {
|
||||
const { firstname, lastname, phone_number, email } = newContactPerson;
|
||||
|
Reference in New Issue
Block a user