|
@@ -188,6 +188,8 @@ function calculateStatistics(person, events, timesheetInfo, prodCalendar, formul
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ knownDays = Object.keys(perDayInfo).length;
|
|
|
+
|
|
|
if (events != null) {
|
|
|
var eventsLength = events.length;
|
|
|
|
|
@@ -281,10 +283,10 @@ function calculateStatistics(person, events, timesheetInfo, prodCalendar, formul
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- if (dayInfo.skipped) {
|
|
|
+ if (dayInfo.skipped && knownDays > 0) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (prodCalendar[date].cps_isfilled == 0) {
|
|
|
+ if (prodCalendar[date].cps_isfilled == 0 && knownDays > 0) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -351,6 +353,11 @@ function calculateStatistics(person, events, timesheetInfo, prodCalendar, formul
|
|
|
|
|
|
//console.log('perDayInfo', perDayInfo);
|
|
|
|
|
|
+ if (knownDays == 0) {
|
|
|
+ visitsExpected = NaN;
|
|
|
+ secondsExpected = NaN;
|
|
|
+ }
|
|
|
+
|
|
|
return result = {
|
|
|
days: days,
|
|
|
visits: visits,
|