Skip to content

Commit 7fc0bd3

Browse files
authored
Merge pull request #13 from ndbroadbent/fix_collection_date_on_current_day
2 parents 7e35f33 + 38849b5 commit 7fc0bd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

time.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func adjustYear(t time.Time) time.Time {
1010
today := now()
1111
thisYear := today.Year()
1212
t = t.AddDate(thisYear, 0, 0)
13-
// year correction
14-
if t.Before(today) && today.Format("20060102") != t.Format("20060102") {
13+
// year correction if date is over a week ago
14+
if t.Before(today.AddDate(0, 0, -7)) && today.Format("20060102") != t.Format("20060102") {
1515
t = t.AddDate(1, 0, 0)
1616
}
1717
return t

0 commit comments

Comments
 (0)