Correct the nbday calculation

This commit is contained in:
jacques 2020-12-23 09:39:21 +01:00
parent 17decf6916
commit 267be7ad92

View file

@ -80,11 +80,11 @@ class UtilDate {
* @return int numbers of days between date and today * @return int numbers of days between date and today
* Number of days between date (older than today) 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 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 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);
} }
/** /**