You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
391 B
12 lines
391 B
"use strict";
|
|
const utils_cache = require("./cache.js");
|
|
const isNewDay = (value, key) => {
|
|
const lastVisitTime = utils_cache.cache.get(key);
|
|
const currentTime = new Date().toDateString();
|
|
const isNewDay2 = !lastVisitTime || lastVisitTime !== currentTime;
|
|
if (isNewDay2 && value) {
|
|
utils_cache.cache.set(key, currentTime);
|
|
}
|
|
return isNewDay2;
|
|
};
|
|
exports.isNewDay = isNewDay;
|
|
|