spacetime-week-math
v0.0.1
Published
calculate nth week of the month
Downloads
4
Readme
a spacetime plugin to calculate the nth day of a month.
like .week() which is based on the year, .monthWeek() works as a getter+setter, based on the input param:
// Oct 2020 starts on a thursday
let s = spacetime('saturday oct 10th 2020')
s.monthWeek()
// 2
s = s.monthWeek(1)
// Mon Sep 28th
the week numbers start at 1.
Note: the getter/setter can produce different results:
let s = spacetime('saturday oct 10th 2020')
s = s.monthWeek(1)
// Mon Sep 28th
s.monthWeek()
// 5Sep 28th is considered the 5th week of September.
work-in-progress.
MIT
