diff --git a/backend/gtime/gtime_test.go b/backend/gtime/gtime_test.go index 2247c8df1..af2bad736 100644 --- a/backend/gtime/gtime_test.go +++ b/backend/gtime/gtime_test.go @@ -22,7 +22,6 @@ func TestParseInterval(t *testing.T) { {inp: "2w", duration: 2 * 168 * time.Hour}, {inp: "1M", duration: time.Duration(daysInMonth * 24 * int(time.Hour))}, {inp: "1y", duration: time.Duration(daysInYear * 24 * int(time.Hour))}, - {inp: "5y", duration: time.Duration(calculateDays5y() * 24 * int(time.Hour))}, {inp: "invalid-duration", err: regexp.MustCompile(`^time: invalid duration "?invalid-duration"?$`)}, } for i, tc := range tcs { @@ -85,22 +84,6 @@ func calculateDays() (int, int) { return daysInMonth, daysInYear } -func calculateDays5y() int { - now := time.Now().UTC() - currentYear, currentMonth, currentDay := now.Date() - - var daysInYear int - - for i := 0; i < 5; i++ { - t1 := time.Date(currentYear+i, currentMonth, currentDay, 0, 0, 0, 0, time.UTC) - t2 := t1.AddDate(1, 0, 0) - - daysInYear += int(t2.Sub(t1).Hours() / 24) - } - - return daysInYear -} - func TestFormatInterval(t *testing.T) { testCases := []struct { name string