Created
December 9, 2017 18:35
-
-
Save yowainwright/1fe03cb6cf95193d0bfe185a494d3273 to your computer and use it in GitHub Desktop.
Input Frequency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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