WorkTimeTracker is a lightweight vanilla JS web application for tracking working hours with automatic Google Sheets integration.
| Start Page | Running Timer |
|---|---|
| Work time reached | Overtime counter |
|---|---|
- Simple start & stop time tracking
- Automatic break time calculations compliant with German labor law
- Real-time countdown to work day completion
- Overtime tracking
- Automatic data storage in Google Sheets
- Local storage backup
- Mobile-first interface
- Configurable work day duration
- Automatic (configurable) break deductions:
- First break (30 minutes) after 6 hours
- Second break (15 minutes) after 9 hours
- Real-time display of:
- Start and estimated Stop time
- Remaining work time
- Total worked time
- Overtime duration
- Pure vanilla JavaScript, HTML, and CSS
- No external dependencies
- Google Apps Script integration
Automatically logs:
- Date
- Start time
- End time
- Gross working time
- Break time
- Net working time
- Daily time balance
To set up the project, follow these steps:
- Clone the repository.
- Copy
./js/config.template.jsto./js/config.js - Create a new Google Sheet.
- Insert the following headers in the first row:
Date,Start time,End time,Gross working time,Break time,Net working time,Difference target / actual. - In cell
H:1, insert the calculation of your time credit:=SUM(G:G;G1). - Delete all empty rows.
- In Google Sheet, go to
Extensions->Apps Script. - Paste the contents of
./js/apps_script.jsinto the editor. - In the Apps Script Editor, update the
SPREADSHEET_IDvariable with the ID of your Google Sheet (part of the URL). - Deploy the script as a web app by clicking the
Deploybutton and selectingNew deployment. - Copy the URL of the web application and update the
APPS_SCRIPT_URLin./js/config.jswith your URL. - (Optional) Customize the
PLANNED_WORK_DAY_HOURS,FIRST_BREAK_THRESHOLD_HOURS,FIRST_BREAK_MINUTES,SECOND_BREAK_THRESHOLD_HOURSandSECOND_BREAK_MINUTESvariables in./js/config.jsto fit your needs. - (Optional) Copy the files (except
./screenshots/andREADME.md) to a (static) web server of your choice. - Visit the web server's URL in your browser OR open the
index.htmlfile directly in your browser. - Start tracking your working hours by clicking the
Startbutton. A new row will be added to your Google Sheet with the current date and time. - Click the
Stopbutton to stop tracking your working hours. The end time will be added to the row in your Google Sheet.