Skip to content
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
0:00:00
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-model is the list of entries. Each entry has an id, a task, and a start and an end in milliseconds since 1970.
  • v-model:running holds 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:running is 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.
  • locale formats the days and times. time-zone sets 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 labels or a label pack. The API table lists the keys.

Usage ​

ts
import { BlessTimeTracker } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
localestring"en"
timeZonestring—an IANA time zone for the days and times; set it when you render on a server
labelsPartial<{ task: string; start: string; stop: string; remove: (task: string) => string; total: string; untitled: string; duration: (h: number, m: number) => string; }>—
modelValueBlessTimeEntry[][]
running{ task: string; start: number; } | nullnullthe task that runs now, if any; keep it in your store so a reload does not lose it

Events

NamePayloadDescription
update:modelValue[value: BlessTimeEntry[]]
update:running[value: { task: string; start: number; } | null]

Released under the MIT License. Character names and artwork belong to their owners.