Skip to content

Commit

Permalink
Change start education year date to 01 september
Browse files Browse the repository at this point in the history
  • Loading branch information
berejant committed Sep 27, 2024
1 parent e6e5e01 commit fe22324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dekanat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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--
}

Expand Down
4 changes: 2 additions & 2 deletions dekanat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit fe22324

Please sign in to comment.