Update widgets at midnight (#634)

This commit is contained in:
Kristian Tashkov
2020-09-06 01:25:46 +03:00
committed by GitHub
parent ea019321e6
commit d59ab89426
8 changed files with 51 additions and 8 deletions

View File

@@ -164,6 +164,8 @@ public class ReminderScheduler implements CommandRunner.Listener
{
void scheduleShowReminder(long reminderTime, Habit habit, long timestamp);
void scheduleWidgetUpdate(long updateTime);
void log(String componentName, String msg);
}
}

View File

@@ -175,9 +175,14 @@ public abstract class DateUtils
return getStartOfDay(getLocalTime());
}
public static long getStartOfTomorrow()
{
return getUpcomingTimeInMillis(0, 0);
}
public static long millisecondsUntilTomorrow()
{
return getStartOfToday() + DAY_LENGTH - getLocalTime();
return getStartOfTomorrow() - getLocalTime();
}
public static GregorianCalendar getStartOfTodayCalendar()