diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js
index b4fb6a2..1c87cbd 100644
--- a/src/views/Dashboard/DashboardProject.js
+++ b/src/views/Dashboard/DashboardProject.js
@@ -584,15 +584,23 @@ const DashboardProject = () => {
{!isReadyOverdueActivities && }
{isReadyOverdueActivities && overdueActivities && overdueActivities.length < 1 &&
No overdue activity found.
}
{isReadyOverdueActivities && overdueActivities && overdueActivities.length > 0 && overdueActivities.map((item, idx) => {
- let end_date = null;
- let today = null;
+ let end_date;
+ let planned_end;
let diffDays = 0;
let message = '';
if (item.end_date && item.end_date !== null) {
end_date = moment(item.end_date);
- today = moment(new Date());
- diffDays = today.diff(end_date, 'days');
- message = `Overdue by ${diffDays} days`;
+ planned_end = moment(item.planned_end);
+ diffDays = end_date.diff(planned_end, 'days');
+ if (isNaN(diffDays)) {
+ return null;
+ } else {
+ if (diffDays > 0) {
+ message = `Overdue by ${diffDays + 1} days`;
+ } else {
+ return null;
+ }
+ }
}
return
})}