From 078db844df01a65b7bd54fff9110aa2730022501 Mon Sep 17 00:00:00 2001 From: jacques Date: Mon, 7 Dec 2020 11:34:29 +0100 Subject: [PATCH] Minors changes --- app/src/main/java/net/foucry/pilldroid/UtilDate.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/UtilDate.java b/app/src/main/java/net/foucry/pilldroid/UtilDate.java index 8c6d968..6c25223 100644 --- a/app/src/main/java/net/foucry/pilldroid/UtilDate.java +++ b/app/src/main/java/net/foucry/pilldroid/UtilDate.java @@ -17,7 +17,7 @@ class UtilDate { private static final String TAG = UtilDate.class.getName(); /** - * @param aDate anydate + * @param aDate any date * @return date the same date as input but at noon (12:00:00 PM) * set date time at Noon */ @@ -30,6 +30,7 @@ class UtilDate { calendar.set(Calendar.HOUR_OF_DAY, 12); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } @@ -79,11 +80,11 @@ class UtilDate { * @return int numbers of days between date and today * Number of days between date (older than today) and today */ - static int nbOfDaysBetweenDateAndToday(Date date) { + static long nbOfDaysBetweenDateAndToday(Date date) { Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon - return (int) (todayDate.getTime() - oldDate.getTime()); + return (todayDate.getTime() - oldDate.getTime()); } /**