| 1 |
export const isAtLeastNDaysAgo = (dateString = new Date(), numDays = 0) => { |
| 2 |
const siteCreatedDaysAgo = Math.floor( |
| 3 |
(Date.now() - new Date(dateString)) / (1000 * 60 * 60 * 24), |
| 4 |
); |
| 5 |
// Account for future time zones by min 0 |
| 6 |
return Math.max(0, siteCreatedDaysAgo) >= Number(numDays); |
| 7 |
}; |
| 8 |
|