Should date-related filters refer to record date or to real date #348
Replies: 1 comment
-
|
Klog is less "underlying chronological data"-driven than some others, but its notation is really what sets it apart—together with the spotless specification, excellent manuals and good-looking reports! In general, I want my systems to blow up if their data is inconsistent: that's a fail-state. Your user isn't counting on you to make sure days don't exceed 24 hours unless you travelled from Paris to Boston that day: the sanitisation is left to the user, by design, and I think it's unique, simple and brilliant. -- Another dimension to my idea was to restrict the contexts in which this mechanisms would kick off to queries that are only about a single date at a time, and further by having it waiting behind a specific flag. -- I would almost recommend to forget about it, were it not for one case that still seems salient: that of querying for the ranges that haven't closed yet. It's quite striking while, just because the clock struck midnight, my However, that is trivially resolved by closing Open Ranges that are too far in the past to even be "closeable" by -- |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This was originally brought up by @ccjmne in #285 (comment).
Currently, all date-related filters (such as
--today,--since,--date, etc.) refer to the “formal” date of the record, not to the “real/actual” date. Consider this example:klog total --date 2000-01-01then it reports3hklog total --date 2000-01-02then it reports0m.Formally speaking, this is correct, because the
--datefilter applies to the record date. Logically speaking, this is not correct, because the3hwould actually split across two adjacent calendar days (2h+1h).The same applies for open ranges:
Say on
2000-01-02you doklog total --today --now, then it would report0m, even though yesterday’s open range is still ongoing.Currently, this behaviour is by design, but I see how it may create confusion.
I’m not sure whether this would resolve if the notion of the date-related filters were to change from “formal date” to “real date” – it may not be fully intuitive either way. There are also other corner-cases, which cannot be caught at all – think, if a record contains an entry of
30h(which is allowed), then it’s not determined to which of the adjacent days the “overflowing” time would belong.There could be other approaches, such as emitting a warning if klog detects that there are adjacent records with shifted times or unclosed open ranges.
Ultimately, I suppose this is a bit of a shortcoming of the notation concept of klog.
Beta Was this translation helpful? Give feedback.
All reactions