From fe2232499a9b0c69b67e5816c9fdfffced880251 Mon Sep 17 00:00:00 2001 From: Anton Berezhnyi Date: Thu, 26 Sep 2024 20:26:29 -0400 Subject: [PATCH] Change start education year date to 01 september --- dekanat.go | 2 +- dekanat_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dekanat.go b/dekanat.go index ea63c35..570bba1 100644 --- a/dekanat.go +++ b/dekanat.go @@ -109,7 +109,7 @@ func extractEducationYear(dbStateDatetime time.Time) (int, error) { year-- } - if month == 9 && dbStateDatetime.Day() < 5 { + if month == 9 && dbStateDatetime.Day() < 1 { year-- } diff --git a/dekanat_test.go b/dekanat_test.go index f5662ac..7400078 100644 --- a/dekanat_test.go +++ b/dekanat_test.go @@ -140,8 +140,8 @@ func TestExtractEducationYearValidInput(t *testing.T) { time.Date(2023, 6, 15, 4, 0, 0, 0, loc): 2022, time.Date(2023, 8, 1, 4, 0, 0, 0, loc): 2022, // after 5 september 2023 year should be 2023 - time.Date(2023, 9, 4, 4, 0, 0, 0, loc): 2022, - time.Date(2023, 9, 5, 4, 0, 0, 0, loc): 2023, + time.Date(2023, 9, 0, 4, 0, 0, 0, loc): 2022, + time.Date(2023, 9, 1, 4, 0, 0, 0, loc): 2023, time.Date(2023, 11, 1, 4, 0, 0, 0, loc): 2023, }