From 267be7ad924c7f32c4f79fd21bbdae1ab2545c29 Mon Sep 17 00:00:00 2001 From: jacques Date: Wed, 23 Dec 2020 09:39:21 +0100 Subject: [PATCH] Correct the nbday calculation --- app/src/main/java/net/foucry/pilldroid/UtilDate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/UtilDate.java b/app/src/main/java/net/foucry/pilldroid/UtilDate.java index 6c25223..7253ea4 100644 --- a/app/src/main/java/net/foucry/pilldroid/UtilDate.java +++ b/app/src/main/java/net/foucry/pilldroid/UtilDate.java @@ -80,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 long nbOfDaysBetweenDateAndToday(Date date) { + static int 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 (todayDate.getTime() - oldDate.getTime()); + return (int) (todayDate.getTime() - oldDate.getTime())/(86400*1000); } /**