This commit is contained in:
Hamcha 2017-05-04 21:04:47 +02:00
parent d69e748968
commit 1ae8af29ce

View file

@ -186,7 +186,8 @@ func parseDuration(date string) (time.Time, error) {
default:
return now, fmt.Errorf("Non capisco quando dovrei ricordartelo!")
}
targetDate := time.Date(year, month, day, hour, min, sec, 0, time.LoadLocation("Local"))
loc, _ := time.LoadLocation("Local")
targetDate := time.Date(year, month, day, hour, min, sec, 0, loc)
if targetDate.Before(now) {
return now, fmt.Errorf("Non posso ricordarti cose nel passato!")
}