npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

themondays

1.0.5

@mikeal

npmSnykSocket
Downloads:14
$ npm install themondays
DailyWeeklyMonthlyYearly

the mondays

1216 587

A generator that yields every monday from now until a specific cutoff.

const main = require('./')

const limit = Date.now() - (main.oneday * 28)

const weeks = []
for (const week of main(limit)) {
  weeks.push(week)
}
console.log(weeks)

The times are yielded as integers since that is what is best for performance. They can easily be converted to a datetime object with new Date(week).