Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/utilities/helpers/formatting.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
export default {
formatCurrency: (currency) => {
return Number(currency).toLocaleString();
},
formatDate: (date) => {
var myDate = new Date(date);
var myDateString = (padZero(myDate.getDate()))+ '-' + (padZero(myDate.getMonth()+1))+ '-' + myDate.getFullYear();
return myDateString;
},
formatCurrency: () => {}, // TODO: Format currency with comma separated => 5,000,000
formatDate: () => {}, // TODO: Format date to dd-mm-yyyy
};
11 changes: 2 additions & 9 deletions src/utilities/helpers/validation.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
export default {
isValidEmail: (email) => {
// First check if any value was actually set
if (email.length == 0) return false;
// Now validate the email format using Regex
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(email);
},
isValidPassword: (passwd) => {
return /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/.test(passwd);
},
isValidEmail: () => {}, // TODO: check if email is valid, using standard email validation
isValidPassword: () => {}, // TODO: check if password is valid, using common password validation
};