0.0.6 • Published 7 years ago

weekrun-calendar v0.0.6

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

WeekRunCalendar

Library for calendar events recurring by 2 or 4 week period

Epoch

Jan. 1, 2017 was Sunday, which is a good starting point to create a calendar system runs by week.

Periodic

DecimalBinary
50101Each odd week starts from the epoch
101010Each even week starts from the epoch
100011st, 5th, 9th week and so on
200102nd, 6th, 10th week and so on
401003rd, 7th, 11th week and so on
810004th, 8th, 12th week and so on

Usage

> const cal = require('weekrun-calendar')
undefined
> cal.nextRecurringDate(new Date(2017, 0, 1), 'sun', 5).toDateString()
'Sun Jan 01 2017'
> cal.nextRecurringDate(new Date(2017, 0, 2), 'sun', 5).toDateString()
'Sun Jan 15 2017'
> cal.nextRecurringDate(new Date(2017, 0, 1), 'sun', 10).toDateString()
'Sun Jan 08 2017'
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago