We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e35f33 + 38849b5 commit 7fc0bd3Copy full SHA for 7fc0bd3
time.go
@@ -10,8 +10,8 @@ func adjustYear(t time.Time) time.Time {
10
today := now()
11
thisYear := today.Year()
12
t = t.AddDate(thisYear, 0, 0)
13
- // year correction
14
- if t.Before(today) && today.Format("20060102") != t.Format("20060102") {
+ // year correction if date is over a week ago
+ if t.Before(today.AddDate(0, 0, -7)) && today.Format("20060102") != t.Format("20060102") {
15
t = t.AddDate(1, 0, 0)
16
}
17
return t
0 commit comments