Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Input Frequency
switch (inputFrequency) {
case 1:
date = this.nextBillDateIsWithinOneMonth(nextBillDate) ?
moment(nextBillDate) : moment(nextBillDate).subtract(1, 'month')
break
case > initialFrequency:
newFrequencyDelta = (inputFrequency - initialFrequency)
date = moment(nextBillDate).add(newFrequencyDelta, 'month')
break
default:
date = moment(nextBillDate).add(1, 'month')
break
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.