Skip to content

Commit

Permalink
fill in non-work days with null values
Browse files Browse the repository at this point in the history
  • Loading branch information
markdturner committed Sep 7, 2024
1 parent 800ebbc commit 28327ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/api/timesheet/services/timesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,16 @@ module.exports = ({ strapi }) => ({
summary.days.nonBillable.push((dailyTimesheetSummary.nonBillable.reduce((total, entry) => total + entry.timeInterval.duration, 0) / 60 / 60 / 7.4).toFixed(1))
summary.days.volunteered.push((dailyTimesheetSummary.volunteered.reduce((total, entry) => total + entry.timeInterval.duration, 0) / 60 / 60 / 7.4).toFixed(1))
}
else {
summary.days.capacity.push(null)
summary.days.assigned.push(null)
summary.days.leave.push(null)
summary.days.sickness.push(null)
summary.days.recorded.push(null)
summary.days.billable.push(null)
summary.days.nonBillable.push(null)
summary.days.volunteered.push(null)
}

date = date.plus({days: 1})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2024-09-04T15:14:46.925Z"
"x-generation-date": "2024-09-05T07:36:38.358Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down

0 comments on commit 28327ed

Please sign in to comment.