Classy Pay library to generate a schedule for a recurring start date.
git clone https://github.com/classy-org/classypay-schedule.git
cd classypay-schedule
yarn install
node ./bin/schedule.js
Get the schedule for a given recurring start date:
node ./bin/schedule.js schedule 2018-06-21
February 29th will be converted to February 28th during leap years.
This tool will be used to generate a schedule for a given ISO date: YYYY-MM-DD. The schedule will include MONTHLY, QUARTERLY, and YEARLY dates that correspond to start dates (stored in Pay) which share the scheduled charge date supplied in the request.
When a client creates, adds or updates a recurring plan on Classy Pay, Classy Pay will return the schedule as part of the response. In addition, Pay will attempt to sync the schedule with any valid recurring sync operations to APIv2.
Within Classy Pay itself, the schedule will be used to find all recurring plans which should be charged for the day.
- msort(a, b) ⇒
Number
Sort.
- generateSchedule(date, count, interval) ⇒
Object
Given a moment, generate a schedule given count and interval.
- getSchedule(date) ⇒
Object
Given a valid ISO date, generate a schedule.
Sort.
Kind: global function
Returns: Number
- lt/gt
Param | Type | Description |
---|---|---|
a | * |
a |
b | * |
b |
Given a moment, generate a schedule given count and interval.
Kind: global function
Returns: Object
- A schedule.
Param | Type | Default | Description |
---|---|---|---|
date | Moment |
A moment in time. | |
count | number |
1 |
The number of dates to generate. |
interval | number |
The number of months to add for each interval. |
Given a valid ISO date, generate a schedule.
Kind: global function
Returns: Object
- A schedule.
Param | Type | Description |
---|---|---|
date | String |
A valid ISO date. |