Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

Commit

Permalink
Update Toggl.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
GeNiuS69 authored Jan 8, 2019
1 parent 0e43918 commit 9847efc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/tools/Toggl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ export default class Toggl {
*/
private getDateRangesForYear(activeYear: number) {
const now = new Date();
now.setFullYear(activeYear);
const firstDayOfYear = new Date(activeYear, 0, 1);

const untilDate = isSameYear(now, firstDayOfYear)
? now
: lastDayOfYear(now);
: lastDayOfYear(firstDayOfYear);

return {
since: format(firstDayOfYear, 'YYYY-MM-DD'),
Expand Down

0 comments on commit 9847efc

Please sign in to comment.