Work Hours Tracker

← All samples

work-hours.dply
1---
2version: 0.1.0
3precision: 2
4form_title: Work Hours Tracker
5form_description: Track your actual work hours. Enter your daily start/end times, breaks and vacation days to see your weekly, monthly and yearly work hours, including overtime.
6form_inputs: Daily start|start{h}, Daily end|end{h}, Break duration|break_min{min}, Work days per week|work_days, Vacation days|vacation
7form_outputs: Daily hours|daily_hours, Weekly hours|weekly_hours, Monthly hours|monthly_hours, Yearly hours|yearly_hours, Overtime per year|overtime_yearly
8---
9# draftply – Work Hours Tracker
10# How many hours do you really work? Track your time and calculate overtime.
11
12# ── Work schedule ───────────────────────────────────────
13# Times as hours — 8:30 is 8 h + 30 min, and draftply adds the units for you.
14start = 8 h + 30 min # work start time (8:30)
15end = 17 h # work end time (17:00)
16break_min = 30 min # daily break duration
17work_days = 5 # days worked per week
18vacation = 25 # paid vacation days per year
19
20# ── Calculations ──────────────────────────────────────
21# Daily work hours (excluding break) — mixing h and min is fine, the
22# result carries the unit through on its own.
23raw_daily = end - start
24daily_hours = raw_daily - break_min
25
26# Weekly hours
27weekly_hours = daily_hours * work_days
28
29# Standard full-time work hours (Germany: 40h/week)
30standard_weekly = 40 h
31
32# Overtime per week
33overtime_weekly = weekly_hours - standard_weekly
34
35# Monthly hours (average)
36work_weeks_per_year = 52 - vacation / work_days # vacation weeks removed
37monthly_hours = weekly_hours * 4.33 # average weeks per month
38
39# Yearly hours
40yearly_hours = weekly_hours * work_weeks_per_year
41
42# Standard yearly hours — the same 52 weeks minus your vacation, so the
43# comparison is like for like.
44standard_yearly = standard_weekly * work_weeks_per_year
45
46# Total overtime per year
47overtime_yearly = yearly_hours - standard_yearly
48
49# ── Results ─────────────────────────────────────────────
50"Daily work hours (excl. break)": daily_hours
51"Break duration": break_min
52
53"Weekly hours": weekly_hours
54"Overtime per week": overtime_weekly
55"Monthly hours (~)": monthly_hours
56"Yearly hours (~)": yearly_hours
57
58"Standard (40h/week, same vacation)": standard_yearly
59"Overtime per year": overtime_yearly
60
61# What if you worked one hour more every day?
62extra_weekly = 1 h * work_days
63extra_yearly = extra_weekly * work_weeks_per_year
64"With +1h daily: yearly hours": yearly_hours + extra_yearly
65"With +1h daily: yearly overtime": overtime_yearly + extra_yearly
66
67# Effective hourly rate calculation (if you know your salary)
68# Uncomment and adjust to use:
69# salary_yearly = 60000 €
70# hourly_rate = salary_yearly / yearly_hours
71# "Effective hourly rate": hourly_rate
72