diff --git a/src/components/Summary.test.tsx b/src/components/Summary.test.tsx index 4f43e13..3e6d222 100644 --- a/src/components/Summary.test.tsx +++ b/src/components/Summary.test.tsx @@ -36,7 +36,7 @@ describe('Summary tests', () => { />, ); expect(screen.getByTestId('summary').innerHTML).toMatchInlineSnapshot(` - "Total: 17h0m + "Total billable: 16h40m By project: A: 5h40m @@ -93,7 +93,7 @@ describe('Summary tests', () => { />, ); expect(screen.getByTestId('summary').innerHTML).toMatchInlineSnapshot(` - "Total: 6h0m + "Total billable: 6h0m By project: A: 6h0m diff --git a/src/components/Summary.tsx b/src/components/Summary.tsx index cea7f93..5655aae 100644 --- a/src/components/Summary.tsx +++ b/src/components/Summary.tsx @@ -48,8 +48,13 @@ export const Summary: React.FC = ({ entries, now }) => { summaryByDescription[description] += seconds; } result = - 'Total: ' + - toHumanTime(Object.values(summary).reduce((a, b) => a + b, 0)) + + 'Total billable: ' + + toHumanTime( + Object.entries(summary) + .filter(([description]) => description !== '[other]') + .map(([, seconds]) => seconds) + .reduce((a, b) => a + b, 0), + ) + '\n\nBy project:\n' + Object.entries(summaryByProject) .sort(([a], [b]) => sort(a, b))