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

how to set availiable time per day to 8h? #532

Open
kajmaj87 opened this issue Apr 20, 2023 · 7 comments
Open

how to set availiable time per day to 8h? #532

kajmaj87 opened this issue Apr 20, 2023 · 7 comments
Labels
discussion Discussion on a topic enhancement New feature or request

Comments

@kajmaj87
Copy link

The output of month command gives such a summary at the end:

$ timew month
...
               Tracked        93:31:12
               Available     626:28:48
               Total         720:00:00

Is it possible to adjust it so that timew counts only 8h per day, but without limiting the calculation to defined values like 9:00-17:00? My work schedule is very flexible and I'm only interested in the amount of work I need to do until the end of month and how many hours in month are there.

Is there a config to change 24h per day to 8h?

@lauft lauft added the discussion Discussion on a topic label Apr 22, 2023
@lauft
Copy link
Member

lauft commented Apr 26, 2023

Is there a config to change 24h per day to 8h?

Currently not.

@kajmaj87
Copy link
Author

Do you think that is something worth looking into? Would this be a good candidate for "first issue"? I'm interested in this and maybe wish to invest my own time into this.

@lauft
Copy link
Member

lauft commented Apr 27, 2023

@kajmaj87 I have given this some thought and did some research.

Currently, one can emulate a 8h work day (40h work week) by setting some exclusions like this

timew config exclusions.monday    '<8:00 >16:00' :yes
timew config exclusions.tuesday   '<8:00 >16:00' :yes
timew config exclusions.wednesday '<8:00 >16:00' :yes
timew config exclusions.thursday  '<8:00 >16:00' :yes
timew config exclusions.friday    '<8:00 >16:00' :yes
timew config exclusions.saturday  '>0:00'        :yes
timew config exclusions.sunday    '>0:00'        :yes

This way you get your desired values:
Screen Shot 2023-04-27 at 07 37 06

But I guess you do not want the exclusion block rendered here...

So as a first step one could implement a configuration value for the chart to not display the exclusion blocks. This should be a good first issue.

I am still contemplating how one can integrate something like working hours.

  • I think they should be configurable on a day level as some people have different values for each day of the week.
  • Can this be somehow integrated into the current concept of exclusions? I think it would be practical, if holidays and defined time offs are taken into account here.
  • How is the available time calculated in case of both exclusion and working hours defined?
  • Emulating working hours with exclusions has some side effects, e.g. when an open interval overlaps with such an exclusion. How can we deal with this case?

So, I see a good starting point but also some head scratching ahead. Are you still in?

@kajmaj87
Copy link
Author

kajmaj87 commented Apr 27, 2023

How does this emulation work when someone has flexible working time? My issue is that I usually start at 7:00 and have a few short breaks during the day when I turn the timer off and also do some work between 17:00 and 20:00, this is something I cannot predict.
My idea was to only change the calculated values in report, in such a way that you are able to exceed the available hours and this would actually mean that you did overhours that day (monthly could also be negative meaning the same)

For me personally it would be best if exclusions and amount of working hours are separate things, maybe mutually exclusive based on configuration. Of course it would be best if holidays are taken into account thought.

Yes, I'm interested in this and would like to contribute but cannot promise how fast this would go (not my main focus and C++ not being my "native" language).

@lauft
Copy link
Member

lauft commented Apr 27, 2023

How does this emulation work when someone has flexible working time? My issue is that I usually start at 7:00 and have a few short breaks during the day when I turn the timer off and also do some work between 17:00 and 20:00, this is something I cannot predict.

An exclusion does not mean you cannot track time then. Only open intervals get truncated then, but when you tell Timewarrior to stop tracking within an exclusion, the interval is closed at the specified time, not at the exclusion border.

My idea was to only change the calculated values in report, in such a way that you are able to exceed the available hours and this would actually mean that you did overhours that day (monthly could also be negative meaning the same) ...
Yes, I'm interested in this and would like to contribute but cannot promise how fast this would go (not my main focus and C++ not being my "native" language).

Ok, let's do a POC adding a separate line Work hours: <done>/<required> (or maybe <required - done>, i.e. negative values mean overtime) between Available and Total. Start with a hardcoded value of 8h per day and see how far you get. Later we can talk about configuration and adding holidays and more...

@kajmaj87
Copy link
Author

Ok, let me try, I'll report back when I have something.

@lauft lauft added the enhancement New feature or request label May 26, 2023
@aksdb
Copy link

aksdb commented Oct 5, 2023

In addition to "per day" a "per week" or even "per month" config might be useful for some workplaces as well. If I work 40h each week, it doesn't matter if I do 8h for 5 days, or maybe 10h for 4 days or if I work a bit longer on Monday and then realize on Friday that I can go home earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion on a topic enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants