Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clocker report bug for overnight entries #39

Closed
fnogatz opened this issue Jul 24, 2018 · 3 comments
Closed

clocker report bug for overnight entries #39

fnogatz opened this issue Jul 24, 2018 · 3 comments
Labels

Comments

@fnogatz
Copy link
Owner

fnogatz commented Jul 24, 2018

When an entry lasts longer than midnight, clocker report returns wrong results.

Steps to reproduce:

> mkdir /tmp/clocker
> clocker -d /tmp/clocker start
> clocker -d /tmp/clocker set start 'yesterday 22:00'
> clocker -d /tmp/clocker stop
> clocker -d /tmp/clocker set end '06:00'
> clocker -d /tmp/clocker list
1532376000  2018-07-23  [ 22:00:00 - 06:00:00 ]  (08:00:00)
> clocker -d /tmp/clocker report
Report for 24 July 2018:


total: 00:00:00

There are 6 hours missing :)

@BeniRupp, any chance you could provide a fix for this?

@fnogatz fnogatz added the bug label Jul 24, 2018
@BeniRupp
Copy link
Collaborator

You are right! Thanks for reporting this bug! 👍

The 6 hours are not really missing, because if you run clocker report --reportDay 2018-07-23 you will get 8 hours as total workload. But I agree, that is not what we would expect.

So I will have a look on the total workload calculation to provide a more appropriate solution.

BeniRupp added a commit to BeniRupp/clocker that referenced this issue Feb 22, 2019
Worklogs with different start and end dates are handled correctly by the
report command.

Fixes fnogatz#39
@BeniRupp
Copy link
Collaborator

BeniRupp commented Feb 22, 2019

Sorry for the late reply. 🙈 But I've tried to fix that issue with some colleagues at the Hackergarten this week. (Thanks to @codestoe, @wandertaker, @konqi and Robin)

This is just a bug fix. For further report functionallity (weeks, month, ...) we should re-think the data saved in the database. One idea is to split up a worklog when define the end of it in a way that we have one entry per day with the correct amount of time spent on this item. So we can query the data by the start date again:

So 2019-02-02 22:00:00 - 2019-02-03 06:00:00 is saved in the database as:

  • 2019-02-02 22:00:00 - 2019-02-03 00:00:00
  • 2019-02-03 00:00:00 - 2019-02-03 06:00:00

@fnogatz
Copy link
Owner Author

fnogatz commented Feb 26, 2019

Thank you for the input. I moved some parts of the discussion into a new issue #43.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants