studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
20 lines (19 loc) • 614 B
JavaScript
const checkDate = (date) => {
return {
isInLast24Hours() {
const twentyFourHoursAgo = new Date(Date.now() - 24 * 60 * 60 * 1e3);
return date >= twentyFourHoursAgo && date <= /* @__PURE__ */ new Date();
},
isInLast7Days() {
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1e3);
return date >= sevenDaysAgo && date <= /* @__PURE__ */ new Date();
},
isInLast30Days() {
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1e3);
return date >= thirtyDaysAgo && date <= /* @__PURE__ */ new Date();
}
};
};
export {
checkDate
};