Calm motion: animations on this site only fade, with no movement
Time tracker
A timer for the current task and a list of time entries with a total for each day
Records how long each task takes, for billing a client or for a timesheet. For a countdown, use the timer.
Basic
Tuesday, November 17Total 2 h 05 min
- Reply to sponsors10:50 AM–11:20 AM30 min
- Mix episode 4209:00 AM–10:35 AM1 h 35 min
Monday, November 16Total 1 h 55 min
- Edit show notes02:30 PM–03:15 PM45 min
- Record the intro01:00 PM–02:10 PM1 h 10 min
- Type the task and press Start. The clock counts up each second. Stop adds an entry to the list.
v-modelis the list of entries. Each entry has anid, atask, and astartand anendin milliseconds since 1970.v-model:runningholds the task that runs now, with its start time. Keep it in your store, so a reload does not lose a running timer.v-model:runningis the timer that runs. If the parent sets it, for example from another device, the field shows its task.- The entries are grouped by day, newest first. Each day shows its total, and each entry has a delete button with the task in its name.
localeformats the days and times.time-zonesets an IANA time zone. If you render on a server, set it, so the server and the browser show the same day.- Change the words with
labelsor a label pack. The API table lists the keys.
Usage
ts
import { BlessTimeTracker } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
locale | string | "en" | |
timeZone | string | — | an IANA time zone for the days and times; set it when you render on a server |
labels | Partial<{ task: string; start: string; stop: string; remove: (task: string) => string; total: string; untitled: string; duration: (h: number, m: number) => string; }> | — | |
modelValue | BlessTimeEntry[] | [] | |
running | { task: string; start: number; } | null | null | the task that runs now, if any; keep it in your store so a reload does not lose it |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessTimeEntry[]] | |
update:running | [value: { task: string; start: number; } | null] |