Finalized codebase

This commit is contained in:
Argiris Deligiannidis
2024-04-14 20:33:51 +03:00
parent e1b2880a71
commit 25883a5362
564 changed files with 36069 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
const utils = {
/**
* A function that takes a date in the format 'dd/mm/yyyy' and returns the day of the week as a string.
*
* @param {string} date - The input date in the format 'dd/mm/yyyy'
* @return {string} The day of the week
*/
getDay(date) {
let isoDate = date.split('/');
date = isoDate[2] + '-' + isoDate[1] + '-' + isoDate[0];
const names = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const day = new Date(date).getDay();
return names[day];
},
};
export default utils;