Skip to content
This repository was archived by the owner on Jun 25, 2021. It is now read-only.

strong-roots-capital/first-full-week-of-year

Repository files navigation

first-full-week-of-year Build status npm version codecov

Find the first week of a given year composed entirely of days in said year

Note: this package assumes Monday to be the first day of the week.

Install

npm install @strong-roots-capital/first-full-week-of-year

Use

import firstFullWeekOfYear from '@strong-roots-capital/first-full-week-of-year'

console.log(firstFullWeekOfYear(new Date("2019-05-25T00:00:00.000Z")))
//=>  2019-01-07T00:00:00.000Z

Documentation

firstFullWeekOfYear :: Date -> Date
firstFullWeekOfYear :: Date -> Date

Creates a Date object representing the first Monday of the specified year.

Acknowledgments