Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/infra/partition/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ func (p Configuration) getPrevDate(forDate time.Time, i int) (t time.Time, err e
t = time.Date(year, month-time.Month(i), 1, 0, 0, 0, 0, forDate.Location())
case Quarterly:
year, month, _ := forDate.Date()
quarterStartMonth := (month-1)/3*3 + 1
quarter := (int(month) - 1) / nbMonthsInAQuarter
quarterStartMonth := time.Month(quarter*nbMonthsInAQuarter + 1)
t = time.Date(year, quarterStartMonth-time.Month(i*nbMonthsInAQuarter), 1, 0, 0, 0, 0, forDate.Location())
case Yearly:
year, _, _ := forDate.Date()
Expand All @@ -153,7 +154,8 @@ func (p Configuration) getNextDate(forDate time.Time, i int) (t time.Time, err e
t = time.Date(year, month+time.Month(i), 1, 0, 0, 0, 0, forDate.Location())
case Quarterly:
year, month, _ := forDate.Date()
quarterStartMonth := (month-1)/3*3 + 1
quarter := (int(month) - 1) / nbMonthsInAQuarter
quarterStartMonth := time.Month(quarter*nbMonthsInAQuarter + 1)
t = time.Date(year, quarterStartMonth+time.Month(i*nbMonthsInAQuarter), 1, 0, 0, 0, 0, forDate.Location())
case Yearly:
year, _, _ := forDate.Date()
Expand Down
Loading