Fix bug that caused reminders to keep repeating every few seconds

Fixes #351
This commit is contained in:
2017-09-30 13:11:40 -05:00
parent 7bb88dcb97
commit 16f20d50a0
3 changed files with 94 additions and 4 deletions

View File

@@ -42,8 +42,7 @@ public abstract class DateUtils
public static long applyTimezone(long localTimestamp)
{
TimeZone tz = getTimezone();
long now = new Date(localTimestamp).getTime();
return now - tz.getOffset(now);
return localTimestamp - tz.getOffset(localTimestamp - tz.getOffset(localTimestamp));
}
public static String formatHeaderDate(GregorianCalendar day)
@@ -230,8 +229,7 @@ public abstract class DateUtils
public static long removeTimezone(long timestamp)
{
TimeZone tz = getTimezone();
long now = new Date(timestamp).getTime();
return now + tz.getOffset(now);
return timestamp + tz.getOffset(timestamp);
}
public static void setFixedLocalTime(Long timestamp)