Skip to content

Teajey/punch_clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I had trouble keeping track of my work hours when moving between timezones, so I made this app :^)

Install

git clone https://github.com/Teajey/punch_clock.git
cargo install --path punch_clock/

Usage

Start your work session:

$ punch_clock in "This is me, punchin' in"

And when you're done with work:

$ punch_clock out "Okay, I'm done. I give up."

(The comments are optional, but very helpful for reminding yourself why you stopped working in the middle of the day three weeks ago)

I like to use an alias:

$ punch in

Your hours are stored as datetime pairs in plain text in a project root directory .punch_clock/record, like so:

2023-11-09T14:10:51.153842+00:00
2023-11-09T14:30:13.018842+00:00 No time like the present

2023-11-23T08:01:45.948514+00:00
2023-11-23T08:21:38.644514+00:00

2023-11-30T09:01:39.241707+00:00 This is me, punchin' in
2023-11-30T09:02:00.547707+00:00 Okay, I'm done. I give up.

Work hours can be viewed in a calendar:

$ punch_clock calendar 2024-10-01 2024-10-29
Total time: 168 hours, 58 minutes
2024-10-01 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒░ 9 hours, 11 minutes
2024-10-02 ░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒ 8 hours, 21 minutes
2024-10-03 ▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒░▒░▒░ 8 hours, 30 minutes
2024-10-04 ░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒ 9 hours, 49 minutes
2024-10-05 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ 
2024-10-06 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ 
2024-10-07 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░ 8 hours, 8 minutes
2024-10-08 ░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒ 8 hours, 39 minutes
2024-10-09 ▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░ 8 hours, 9 minutes
2024-10-10 ░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒ 9 hours, 14 minutes
2024-10-11 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒░ 9 hours, 3 minutes
2024-10-12 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ 
2024-10-13 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ 
2024-10-14 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ 
2024-10-15 ▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓░▒▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒░ 8 hours, 56 minutes
2024-10-16 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒░▒ 5 hours, 24 minutes
2024-10-17 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▓▓▓▓▓▓▒░▒░▒░▒░ 10 hours, 18 minutes
2024-10-18 ░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒░▒ 9 hours, 22 minutes
2024-10-19 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ 
2024-10-20 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ 
2024-10-21 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▓░▒░▒▓▓▓▓▓▓▓▓▓▒░▓▓▓▓▒▓▒░▒░▒░▒░ 7 hours, 6 minutes
2024-10-22 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒░▒ 7 hours, 46 minutes
2024-10-23 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒░ 5 hours, 34 minutes
2024-10-24 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓░▓▓▓▓▓▓▓▓▓░▒░▒░▒ 10 hours, 36 minutes
2024-10-25 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒░▒░▒░▒░▒░ 8 hours, 57 minutes
2024-10-26 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ 
2024-10-27 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ 
2024-10-28 ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░▒ 7 hours, 12 minutes
2024-10-29 ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▓▓▓▓▓▓▓▓▒░▓▓▓▓▓▓▓▓▓░▒░▒░▒░▒░ 8 hours, 35 minutes

Or in a day view:

punch_clock day 2024-10-29
Total time: 8 hours, 35 minutes
00:00 ▒░▒░▒░
01:00 ░▒░▒░▒
02:00 ▒░▒░▒░
03:00 ░▒░▒░▒
04:00 ▒░▒░▒░
05:00 ░▒░▒░▒
06:00 ▒░▒░▒░
07:00 ░▒░▒░▒
08:00 ▒░▒░▒░
09:00 ▓▓▓▓▓▓ In @ 09:53
10:00 ▓▓▓▓▓▓
11:00 ▓▓▓▓▓▓
12:00 ▓▓▓▓▓▓
13:00 ▓▓▓▓▓▓ Out @ 13:55 Lil' grocery shopping
14:00 ▒░▒░▒░
15:00 ▓▓▓▓▓▓ In @ 15:05
16:00 ▓▓▓▓▓▓
17:00 ▓▓▓▓▓▓
18:00 ▓▓▓▓▓▓
19:00 ▓▓▓▓▓▓ Out @ 19:38
20:00 ▒░▒░▒░
21:00 ░▒░▒░▒
22:00 ▒░▒░▒░
23:00 ░▒░▒░▒

Releases

No releases published

Packages

No packages published

Languages