Update CSS, add relationship between sensorModel and locationModel, and remove console.log statements
This commit is contained in:
@ -1,20 +1,14 @@
|
||||
const moment = require("moment");
|
||||
const currentTime = moment().format("YYYY-MM-DD HH:mm:ss");
|
||||
|
||||
//time is taken from the token
|
||||
function isValid(time){
|
||||
const timeDiff = moment(currentTime).diff(time, "minutes");
|
||||
|
||||
if (timeDiff > 1) {
|
||||
console.log(timeDiff);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
function isValid(time) {
|
||||
|
||||
if (
|
||||
Math.floor(new Date(time).getTime() / 1000) <
|
||||
Math.floor(new Date().getTime() / 1000)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports = { isValid };
|
||||
module.exports = { isValid };
|
||||
|
Reference in New Issue
Block a user