Commit b93cf65c by Sebastián Katzer

Fix bug in match trigger where interval is every minute [ref #1533]

parent fc41c7d0
...@@ -191,7 +191,11 @@ public class MatchTrigger extends IntervalTrigger { ...@@ -191,7 +191,11 @@ public class MatchTrigger extends IntervalTrigger {
else else
return null; return null;
case HOUR: case HOUR:
if (cal.get(Calendar.MINUTE) < now.get(Calendar.MINUTE)) {
addToDate(cal, now, Calendar.HOUR_OF_DAY, 1);
} else {
addToDate(cal, now, Calendar.HOUR_OF_DAY, 0); addToDate(cal, now, Calendar.HOUR_OF_DAY, 0);
}
break; break;
case DAY: case DAY:
case WEEK: case WEEK:
......
...@@ -207,7 +207,15 @@ namespace LocalNotificationProxy.LocalNotification.Trigger ...@@ -207,7 +207,15 @@ namespace LocalNotificationProxy.LocalNotification.Trigger
break; break;
case Unit.HOUR: case Unit.HOUR:
if (date.Minute < now.Minute)
{
date = date.AddHours(now.Hour - date.Hour + 1);
}
else
{
date = date.AddHours(now.Hour - date.Hour); date = date.AddHours(now.Hour - date.Hour);
}
break; break;
case Unit.DAY: case Unit.DAY:
case Unit.WEEK: case Unit.WEEK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment