nobodyinperson · GitHub

Hi,

Thank you very much for hledger, it's awesome. I just began using the timeclock format for time tracking. A perfect match with hledger, indeed.

I noticed that it is not directly possible to use tags with the timeclock format. Interestingly, there also seem to be no issues about this topic at all.

Demonstration

Consider the sample.timeclock file from hledger.org, with some tag comments added to the end of each comment:

i 2009/03/27 09:00:00 projects:a  ; successful: yes
o 2009/03/27 17:00:34
i 2009/03/31 22:21:45 personal:reading:online
o 2009/04/01 02:00:34
i 2009/04/02 09:00:00 projects:b  ; successful: no
o 2009/04/02 17:00:34

Now, hledger doesn't ignore these comments:

hledger -f sample.timeclock print
2009-03-27 * ; successful: yes
    (projects:a)           8.01h
2009-03-31 * 22:21-23:59
    (personal:reading:online)           1.64h
2009-04-01 * 00:00-02:00
    (personal:reading:online)           2.01h
2009-04-02 * ; successful: no
    (projects:b)           8.01h

However, hledger also doesn't seem to care about them, as it is not possible to filter by tags now:

hledger -f sample.timeclock bal tag:successful=yes
--------------------
                   0

There exists a workaround by simply parsing the print output again with hledger:

hledger -f sample.timeclock print | hledger -f- bal tag:successful=yes
               8.01h  projects:a
--------------------
               8.01h

Proposal

Handling tags in timeclock format exactly like in the journal format.

Environment

  • up-to-date Manjaro XFCE4
  • hledger 1.17.1.1 from the official repositories

Read the original on github.com ↗