This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Remind me Today -> Starts tomorrow #176
Labels
Milestone
Comments
Happens to us as well. |
It also has been happening to me for a while, whenever I tried to set a reminder later than 14:00 in CEST. t, pErr := time.ParseInLocation(time.Kitchen, strings.ToUpper(normalizedWhen), location)
now := time.Now().In(location).Round(time.Hour * time.Duration(24))
occurrence := t.AddDate(now.Year(), int(now.Month())-1, now.Day()-1) If now: 2020-05-24 15:10:17.815540836 +0200 CEST
rounded now: 2020-05-25 02:00:00 +0200 CEST In this case the
// Round returns the result of rounding t to the nearest multiple of d (since the zero time).
// The rounding behavior for halfway values is to round up.
// If d <= 0, Round returns t stripped of any monotonic clock reading but otherwise unchanged.
//
// Round operates on the time as an absolute duration since the
// zero time; it does not operate on the presentation form of the
// time. Thus, Round(Hour) may return a time with a non-zero
// minute, depending on the time's Location.
func (t Time) Round(d Duration) Time {
t.stripMono()
if d <= 0 {
return t
}
_, r := div(t, d)
if lessThanHalf(r, d) {
return t.Add(-r)
}
return t.Add(d - r)
} |
Since it hasn’t been mentioned here yet, a workaround is to explicitly mention today’s date:
|
Fixed occurence calculation #193 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
/remind me test today -> schedules reminder for tomorrow
/remind me test at 18:00 -> schedules reminder for tomorrow
/remind me test at 18:00 today -> schedules reminder for tomorrow
Steps to reproduce
Steps to reproduce the behavior:
/remind me test today
Reminder is set tomorrow 9am
/remind me test at 18:00 (Current Time 15:00)
Reminder is set tomorrow 6pm
/remind me test at 18:00 today (Current Time 15:11)
Reminder is set tomorrow 6pm
Expected behavior
Reminder should be set to today
Server configuration
Operating system:
Linux Ubuntu
Mattermost version:
5.18.1
Remind version:
0.4.4
Additional context
Experimental timezone support is enabled.
The text was updated successfully, but these errors were encountered: