Created
August 1, 2021 20:11
-
-
Save hakimkal/4bea43af4c5eacb5d97655409bd1b38f to your computer and use it in GitHub Desktop.
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
| object PeriodHelper { | |
| def computeEndDate(periodNum: Long, periodType: RecurringInterval) = { | |
| val days: Long = periodType match { | |
| case RecurringInterval.DAY => 1 * periodNum | |
| case RecurringInterval.WEEK => 7 * periodNum | |
| case RecurringInterval.MONTH => 28 * periodNum | |
| case RecurringInterval.YEAR => 365 * periodNum | |
| case _ => 0 * periodNum | |
| } | |
| LocalDate.now().plusDays(days) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment