mirror of
https://github.com/Lissy93/happy-app.git
synced 2021-05-12 19:52:18 +03:00
Wrote date checking function
This commit is contained in:
@@ -24,7 +24,9 @@ class Helpers {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
static isDateToday(date){
|
||||
return true;
|
||||
const inputDate = new Date(date).setHours(0,0,0,0);
|
||||
const todaysDate = new Date().setHours(0,0,0,0);
|
||||
return inputDate === todaysDate;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,8 @@ class ResponseSaver {
|
||||
ResponseSaver.checkIfUserFoundInTeam(userResponse.emailHash).then(
|
||||
(teamName) => {
|
||||
|
||||
console.log("Team Name: ", teamName);
|
||||
|
||||
/* Check for previous errors, if there immediately resolve*/
|
||||
ResponseSaver.passDownTheError(teamName, resolve);
|
||||
|
||||
@@ -173,13 +175,13 @@ class ResponseSaver {
|
||||
if( Helpers.isDateToday(dateBlock.date)) {
|
||||
dateBlock.userResults.forEach((userResult) => {
|
||||
if(userResult.userHash === userHash){
|
||||
return true;
|
||||
return false
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user