Open simonsan opened 8 months ago
chrono::Utc
for consistency.chrono-tz
for complex time zone rules.Thanks for setting up this issue, much appreciated!
Regarding timezones: I really like the proposal as I think it will work. One test I can think of is:
Something I also wonder about is if it would be good to store the timezone as well, just like Git does. That would allow the times to look natural, no matter from which timezone they are looked at. Think about me being in China for half a month, and in Germany another half. By the end of the month, I generate a timesheet for an invoice. If I am in Germany when doing it, it will look like I worked at night while logging time in China which isn't accurate. Clients might rightfully say that they are afraid of the quality produced by someone with insomnia ;).
So to catch this case, I think the timezone would also have to be stored to be able to store the local time of each task, with the possibility that start and stop are in different timezones.
@Byron I'm sitting on it, but I need some better understanding from the user experience side and I would appreciate your help and ideas for this:
I want to do it in the way, that normally, people don't need to deal at all with timezone shenanigans.
So as a first measurement, I will store a default timezone in the configuration file, which you can choose in the setup assistant that already exists with pace setup config
. For us, this would be Europe/Berlin
. I will further get the local offset from UTC and “guess” the countries you can decide from based on the offset in seconds to use these in the setup assistant's fuzzy select as higher priority, so they will appear closer to the cursor.
As a second measurement, I'll introduce an optional command-line option to set the timezone or an offset from UTC for beginning and ending an activity. So that people have full control over it, even if they set something in their config. I imagine it like:
# short
alias tt = pace
tt b "My activity" -c "development::pace" -tzo +1
# -tzo should not be needed here, as that should be able to be determined
# automatically, but we should probably make it possible, to overwrite it
# or a bit longer
pace begin "My activity" -c "development::pace" -tz Europe/Berlin
pace begin "My activity" -c "development::pace" --tz-offset +1
tz-offset
from local time.Any feedback, if I have forgotten/overlooked anything for usability?
Happily!
(it took me moment to realise, but I think instead of 'measurement' it should be 'measure')
Regarding 1), I really like the idea of a fuzzy & smart country selector to nail the current timezone. I think it should be made clear that this setting only affects changes done after timezone change (even if it means to stop a timer in a new timezone, like would be the case in a cross-country flight).
Regarding 2), even though a short-form like +1
seems reasonable, internally it should store no less than what git stores for a timezone, i.e. sign + hours and minutes. The Europe/Berlin
example indicates that this form at least would already allow that.
Personally I see great benefit in storing dates the Git way, and somehow I consider it a solved problem especially if one wants to lean into what Git already provides. Of course, I have a Git bias, but recommend taking a look at gix-actor
for producing and parsing timestamps.
As long as the timezone is stored per timestamp, and an event as start and end times, I think the data model should be fine for this case (and that's what I vaguely remember to being the case already).
Summary:
Data Storage and Safety:
Data Import:
pace import -t clockify times.csv
).Data Export:
HTML Templating for Reports:
Testing:
Cross-Platform and Syncing:
Originally posted by @Byron in https://github.com/Byron/byron/issues/4#issuecomment-1986367747