Skip to content

Commit

Permalink
add BiMonthly period
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Mar 12, 2019
1 parent 0208094 commit 354b43a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion date.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ const (
PeriodWeek Period = "Weekly"
Period2Week Period = "BiWeekly"
PeriodMonth Period = "Monthly"
Period2Month Period = "BiMonthly"
PeriodQuarter Period = "Quarterly"
PeriodYear Period = "Yearly"
PeriodSemiYear Period = "SemiYearly"
PeriodYear Period = "Yearly"
)

func getDateBoundaries(per Period, start, end time.Time) []time.Time {
Expand All @@ -50,6 +51,9 @@ func getDateBoundaries(per Period, start, end time.Time) []time.Time {
case PeriodMonth:
incMonth = 1
periodStart = time.Date(start.Year(), start.Month(), 1, 0, 0, 0, 0, time.UTC)
case Period2Month:
incMonth = 2
periodStart = time.Date(start.Year(), start.Month(), 1, 0, 0, 0, 0, time.UTC)
case PeriodQuarter:
incMonth = 3
switch start.Month() {
Expand Down

0 comments on commit 354b43a

Please sign in to comment.