add: register & recovery password
This commit is contained in:
12
src/helpers/date_formats.js
Normal file
12
src/helpers/date_formats.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
export const getDateMonthDay = (value) => {
|
||||
const date = new Date(value)
|
||||
return date.toLocaleString(['en-US'], {
|
||||
|
||||
month: 'short',
|
||||
day: '2-digit',
|
||||
year: 'numeric',
|
||||
|
||||
})
|
||||
}
|
||||
18
src/helpers/validations.js
Normal file
18
src/helpers/validations.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export const validateEmail = (email) => {
|
||||
return String(email)
|
||||
.toLowerCase()
|
||||
.match(
|
||||
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
);
|
||||
};
|
||||
|
||||
export const messagesError = (msg) => {
|
||||
switch (msg) {
|
||||
case 'Email is not registered!':
|
||||
return 'No se encontro una cuenta con este email';
|
||||
case 'Wrong OTP':
|
||||
return 'Código ingresado incorrecto';
|
||||
default:
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user