fnogatz / clocker Goto Github PK
View Code? Open in Web Editor NEWCommand-line tool to track project hours
License: Other
Command-line tool to track project hours
License: Other
Is there a way to override this?
ie.
$ clocker start -T MYCLIENT working on my super secret project
For further report functionallity (weeks, month, ...) we should re-think the data saved in the database. One idea is to split up a worklog when define the
end
of it in a way that we have one entry per day with the correct amount of time spent on this item. So we can query the data by the start date again:So
2019-02-02 22:00:00 - 2019-02-03 06:00:00
is saved in the database as:
2019-02-02 22:00:00 - 2019-02-03 00:00:00
2019-02-03 00:00:00 - 2019-02-03 06:00:00
I prefer this generalised solution, too. Let's focus on this as soon as the full rewrite of #40 is merged.
archive used to be able to accept a -t, doesn't anymore
It seems like a lot of things are broken now in a refactor, but the semver major version was not updated accordingly?
Would be great in data to be able to show all the hours for all clients. I know for working on multiple clients in a single day, it would be super helpful. Something like:
$ clocker data -all
invoicer requires a rate field. clocker data -r RATE
used to provide this in the json output, but no longer does this
Hi,
I just noticed some weird behaviour when calling clocker stop
twice. I do this, to make sure no other timers are running (because it is possible to have multiple timers running, see #11).
The second time clocker stop
is called, but there is no timer running, it updates the end timestamp of the last entry.
I think this should not happen and clocker should only update the timestamp for a running task.
Hey @substack, I would like to rename the project's default branch master
to main
, following Git's defaults. A brief summary of the recent developments regarding the shift towards main
instead of master
is given in these articles of GitLab and GitHub. However, I don't have the permissions to do so. Any chances we can change this?
clocker add
currently silently overrides existing entries with an identical beginning:
> mkdir /tmp/clocker
> clocker -d /tmp/clocker add '10:00' '12:00' -t Test1
> clocker -d /tmp/clocker list
1536480000 2018-09-09 [ 10:00:00 - 12:00:00 ] (02:00:00) [Test1]
> clocker -d /tmp/clocker add '10:00' '13:00' -t Test2
> clocker -d /tmp/clocker list
1536480000 2018-09-09 [ 10:00:00 - 13:00:00 ] (03:00:00) [Test2]
I've noticed this repo no longer publishes tags that match with npm's version. Will you be making releases again?
clocker start -t Some
clocker set start '20:55'
clocker set start '20:55'
... and the Some
entry is completely lost 🙀
clocker's internals could be reworked to write operations into an append-only log with hyperlog so that the clocker database can easily be replicated among different machines or across teams of people. The existing command-line interfaces can largely be preserved with a few small modifications to deal with occasional multi-value records. The list and data commands can read from a materialized view of the data created by a hyperlog index.
There was some discussion of this feature already in #12. If nothing else, this would be a very useful backup feature, and this indexing scheme will make it easier to generate different views of the underlying data in the future. This feature should also be integrated with a migration script to automatically port existing data into the new format.
I failed installing clocker in v0.11.13. Contrary to that installing in the latest stable (v0.10.31) worked fine. Here's a trace and some info.
$ npm install -g clocker
...
make: *** [Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory `/home/yuvilio/.nvm/v0.11.13/lib/node_modules/clocker/node_modules/level/node_modules/leveldown/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/yuvilio/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1046:12)
gyp ERR! System Linux 3.13.0-35-generic
gyp ERR! command "node" "/home/yuvilio/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/yuvilio/.nvm/v0.11.13/lib/node_modules/clocker/node_modules/level/node_modules/leveldown
gyp ERR! node -v v0.11.13
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-35-generic
npm ERR! command "/home/yuvilio/.nvm/v0.11.13/bin/node" "/home/yuvilio/.nvm/v0.11.13/bin/npm" "install" "-g" "clocker"
npm ERR! cwd /home/yuvilio/ws/apps/node/nodeschool/promise-it-wont-hurt
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/yuvilio/ws/apps/node/nodeschool/promise-it-wont-hurt/npm-debug.log
npm ERR! not ok code 0
$
$ node --version
v0.11.13
$ uname -a
Linux kamitsukai 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ which node
/home/yuvilio/.nvm/v0.11.13/bin/node
$
Steps to reproduce:
clocker start
clocker stop
clocker set start '$the-date-before 23:59'
This will result in a duration of -23:58:00
instead of the expected 00:02:00
for clocker list
. This is a common mistake if one starts a clocker before midnight, stops it after midnight, and tries to adjust the end time via clocker set end
.
#22 added csv output, which is great! additionally we have the data
option which outputs json, but this is squashed to days to be compatible with invoicer.
I'd like to have the verbose list / csv output formatted as json.
To simplify the api I'd propose a flag for the list
command either like this
clocker list --output=json / --output=csv
, (or --json
/ --csv
) because right now the csv
command basically just reformats the list
output. Maybe we could alias the csv
command to not break the api?
I'd also happily start working on a PR for that. Let me know what you think.
Can probably be handled more nicely by wrapping in a try{...} catch{...}
.
❯ clocker list
events.js:72
throw er; // Unhandled 'error' event
^
OpenError: IO error: lock /Users/yoshuawuyts/.clocker/db/LOCK: Resource temporarily unavailable
at /Users/yoshuawuyts/.nvm/v0.10.35/lib/node_modules/clocker/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:114:34
$ clocker add "2016-01-25-8:45" "2016-01-25-10:20"
$ clocker list
NaN NaN-NaN-NaN [ NaN:NaN:NaN - NaN:NaN:NaN ] (NaN:NaN:NaN)
These are impossible to get rid of using clocker rm
-- their STAMP can't be referenced to.
clocker
should error out on badly formatted dates.
When an entry lasts longer than midnight, clocker report
returns wrong results.
Steps to reproduce:
> mkdir /tmp/clocker
> clocker -d /tmp/clocker start
> clocker -d /tmp/clocker set start 'yesterday 22:00'
> clocker -d /tmp/clocker stop
> clocker -d /tmp/clocker set end '06:00'
> clocker -d /tmp/clocker list
1532376000 2018-07-23 [ 22:00:00 - 06:00:00 ] (08:00:00)
> clocker -d /tmp/clocker report
Report for 24 July 2018:
total: 00:00:00
There are 6 hours missing :)
@BeniRupp, any chance you could provide a fix for this?
Σ ~$ clocker start stuff
Σ ~$ clocker status
elapsed time: 00:00:04
Σ ~$ clocker status
elapsed time: 00:00:09
Σ ~$ clocker list
1392708340 2014-02-18 [ 18:25:40 - NOW ] (00:00:11) [undefined]
Σ ~$ clocker stop
Σ ~$ clocker list
1392708340 2014-02-18 [ 18:25:40 - 18:25:58 ] (00:00:18) [undefined]
Until you've run clocker for the first time, clocker status doesn't show any output.
Hey! 👋
I use clocker for logging my daily workload. So for me it would be great to have a report command which lists all logged hours of the current day with a sum of all types and a total sum.
Maybe something like that:
$ clocker report
Today you logged:
1392707136 2014-02-17 [ 23:00:00 - 02:30:00 ] (03:30:00) [TypeA]
1392751800 2014-02-18 [ 06:00:00 - 12:00:00 ] (06:00:00) [TypeB]
1393020600 2014-02-21 [ 13:15:00 - 17:00:00 ] (03:45:00) [TypeA]
TypeA 07:15:00
TypeB 06:00:00
total 13:15:00
What do you think about this idea? Is there anybody who would be interested in this feature? I think about implementing this feature in the near future and want to collect some feedback. 😉
During the refactoring in #40 the verbose mode of the report command get lost. So we should add it again.
Both days have incorrect totals, off by several hours.
% clocker list
1454519171 2016-02-03 [ 09:06:11 - 10:14:31 ] (01:08:20)
1454538228 2016-02-03 [ 14:23:48 - 15:33:06 ] (01:09:18)
1454612157 2016-02-04 [ 10:55:57 - 11:21:05 ] (00:25:08)
1454616412 2016-02-04 [ 12:06:52 - 17:19:36 ] (05:12:44)
% clocker data
[
{
"hours": [
{
"date": "2016-02-03",
"hours": 4.59
},
{
"date": "2016-02-04",
"hours": 11.26
}
],
"title": "consulting"
}
]
The --reportDay
option of the report command is broken and should be fixed.
return date.getDate() + ' ' + monthNames[date.getMonth()] + ' ' + date.getFullYear()
^
TypeError: date.getDate is not a function
at printDate (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/bin/index.js:623:15)
at Command.report (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/bin/index.js:257:33)
at Command.listener (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/node_modules/commander/index.js:315:8)
at emitTwo (events.js:126:13)
at Command.emit (events.js:214:7)
at Command.parseArgs (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/node_modules/commander/index.js:651:12)
at Command.parse (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/node_modules/commander/index.js:474:21)
at Object.<anonymous> (/Users/beni/.nvm/versions/node/v8.10.0/lib/node_modules/clocker/bin/index.js:170:9)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
Any ideas How to use one clocker db on multiple computers?
I'd like to be able to Start and end one Task on different computers and keep the records synchronized on all computers.
Maybe this is easy solvable with a config File and the possibility to specify a custom db Directory?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.