Skip to content

Commit

Permalink
fix clockify rounding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed May 19, 2024
1 parent da5c8e0 commit 3c2b9f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Version 2.13.0

Compatibility: requires minimum Kimai 2.11.0

- Support importing seconds
- Fixed Clockify duration import rounding issue (see [#4838](https://github.com/kimai/kimai/issues/4838))

## Version 2.12.0

Compatibility: requires minimum Kimai 2.11.0
Expand Down
7 changes: 5 additions & 2 deletions Importer/ClockifyTimesheetImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ public function importRow(Duration $durationParser, ImportData $data, ImportRow
case 'Start Time':
case 'End Date':
case 'End Time':
case 'Duration (h)':
// nothing to do
break;
case 'Duration (decimal)':
case 'Duration (h)':
$values['Duration'] = $durationParser->parseDurationString((string) $value);
break;
case 'Duration (decimal)':
// see https://github.com/kimai/kimai/issues/4838 - rounding issues cause minute loss
// $values['Duration'] = $durationParser->parseDurationString((string) $value);
break;
default:
if (str_starts_with($key, 'Billable Rate')) {
$values['HourlyRate'] = $value;
Expand Down

0 comments on commit 3c2b9f3

Please sign in to comment.