full-week
Calculate the start of the nth full week of a year or month.
API
fullWeek(index, year)
Calculate the start of the nth week of a year
fullWeek(index, year, month = 0)
Calculate the start of the nth week of a month
fullWeek(index, year, month = 0, startOfWeek = 1)
Calculate the start of the nth week of a month defining on what day weeks start
Note: month
and startOfWeek
parameters use JavaScript's indexing approach (January = 0, first day of the week = 0)
Usage
import fullWeek from 'full-week';
fullWeek(1, 2021);
fullWeek(3, 2018, 10);
const firstFullWeek = (year, month) => fullWeek(1, year, month);
firstFullWeek(2018, 10);
firstFullWeek(2019);
fullWeek(-1, 2019, 4);