Open precla opened 3 months ago
Not a bug: the time period 08:29:59 - 16:15:00 is 7h 45m 1s long
edit: Seems to me that it considers seconds when calculating the total time.
edit: yes
would it make sense to add the option to ignore seconds?
Hello! Ignoring seconds seems like an easy solution, but I'm on the fence about it because it would probably require some complex logic especially in statistics to recalculate all records without seconds every time statistics is updated. Hope this make sense. At the moment I've added a different representation for the records like this, showing that is a rounded time (shown in attached screenshot). This record is actually 59m 1s long, but shown as 1h if seconds are disabled.
Maybe it would be possible to round all timestamps before inserting them in the database (= truly ignoring seconds)?
This is also an option, but it would not fix previously created records. Ideally best way would be to store seconds but just ignore them on the ui. But I'm not sure how to do it, maybe it would require too much work and your solution would be implemented in the end :)
Or maybe It's possible to do rounding when reading the DB instead. So basically rounding on the database access layer. Values are stored faithfully, but "cleaned-up" on read.
Pros: it's easy because there is only one place to update in the code (database reading).
Cons: it's kind of a hack 😄
The main problem with doing it on the UI side of things, is that there are a lot of changes to do, potentially forgetting locations.
how about when "Now" is pressed while manually adding an entry (and every where else) - keep seconds. If user sets hh:mm, then set seconds to 00? Would not require any re calculation of old entries, nor a complex logic. And old entries with seconds: it is what it is :)
@cogk Wow, didn't think about rounding on database read. Seems like an interesting idea, will look into it!
see attached screenshot, should be 7:46.
edit: Seems to me that it considers seconds when calculating the total time.