- {!isReadyOverdueActivities &&
}
- {isReadyOverdueActivities &&
- overdueActivities &&
- overdueActivities.length < 1 && (
-
- No overdue activity found.
-
- )}
- {isReadyOverdueActivities &&
- overdueActivities &&
- overdueActivities.length > 0 &&
- overdueActivities.map((item, idx) => {
- 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);
- planned_end = moment(item.planned_end);
- diffDays = end_date.diff(planned_end, "days");
- if (isNaN(diffDays)) {
- return null;
+ return (
+
+ {!isReadyOverdueActivities &&
}
+ {isReadyOverdueActivities &&
+ overdueActivities &&
+ overdueActivities.length < 1 && (
+
+ No overdue activity found.
+
+ )}
+ {isReadyOverdueActivities &&
+ overdueActivities &&
+ overdueActivities.length > 0 &&
+ overdueActivities.map((item, idx) => {
+ 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);
+ 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 {
- if (diffDays > 0) {
- message = `Overdue by ${diffDays + 1} days`;
- } else {
- return null;
- }
+ return null;
}
}
- return (
-
- );
- })}
-
- )
- :
- (
-
- {!dataOverdue &&
}
- {dataOverdue &&
- dataOverdue.length < 1 && (
-
- No overdue activity found.
-
- )}
- {dataOverdue &&
- dataOverdue.length > 0 &&
- dataOverdue.map((item, idx) => {
- let message = `Overdue by ${item.overdue} days`;
- return (
-
- );
- })}
-
- );
- }, [dataOverdue, isReadyOverdueActivities, overdueActivities]);
-
+ }
+ return (
+
+ );
+ })}
+
+ );
+ }, [overdueActivities, isReadyOverdueActivities]);
return (