This is the script that I use for generating my timesheets. Maybe you'll find it useful. But probably not because it does only what I need.
- sanity checks on the data (ex: "is the JSON formatted correctly?", "does the work end after it begins?")
- uses a mustache template to compose the output, so the format is easily customized
- generates PDF output from HTML using wkhtmltopdf
Run node hours.js time.json
to generate a timesheet.pdf from the time.json file.
{
"name": "Bob Bob",
"rate": 10.50,
"days": [
{
"date": "1/1/2015",
"sessions": [
{
"start": "9:00 AM",
"end": "11:30 PM",
"less": 30,
"description": "Did some stuff."
}
}
]
}
- name: your name
- rate: your hourly rate
- sessions: time segments when you are working
- start: the time when you started working
- end: the time when you stopped working
- less: the number of minutes you wasted (for breaks)
- description: what you worked on