Adjust birthday window
This commit is contained in:
parent
bd22c6d681
commit
f21af625c1
|
@ -616,8 +616,8 @@ func (u *User) IsBirthday() bool {
|
||||||
var (
|
var (
|
||||||
now, _ = time.Parse(time.DateOnly, time.Now().Format(time.DateOnly))
|
now, _ = time.Parse(time.DateOnly, time.Now().Format(time.DateOnly))
|
||||||
bday, _ = time.Parse(time.DateOnly, fmt.Sprintf("%d-%d-%d", now.Year(), u.Birthdate.Month(), u.Birthdate.Day()))
|
bday, _ = time.Parse(time.DateOnly, fmt.Sprintf("%d-%d-%d", now.Year(), u.Birthdate.Month(), u.Birthdate.Day()))
|
||||||
startDate = now.Add(-36 * time.Hour)
|
startDate = now.Add(-6 * time.Hour)
|
||||||
endDate = now.Add(36 * time.Hour)
|
endDate = now.Add(60 * time.Hour)
|
||||||
)
|
)
|
||||||
|
|
||||||
return bday.Before(endDate) && bday.After(startDate)
|
return bday.Before(endDate) && bday.After(startDate)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user