0.0.1 • Published 3 years ago

spacetime-week-math v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

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()
// 5

Sep 28th is considered the 5th week of September.

work-in-progress.

MIT

0.0.1

3 years ago