mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Fix bug that caused reminders to keep repeating every few seconds
Fixes #351
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user