Documentation
¶
Overview ¶
Package worktime parses the durations and dates of YouTrack work items.
It mirrors workit's YouTrack time tracking (packages/workit-core youtrack.ts: youTrackParseDuration and youTrackWorkDateMs) so workit can hand its input to ytrack unchanged. Where workit silently drops part of an input ("1h30" is 60 minutes, "1.5h" is 300), ytrack refuses it instead.
Index ¶
Constants ¶
const DateLayout = "2006-01-02"
DateLayout is the layout of work item dates on the command line and in output.
Variables ¶
This section is empty.
Functions ¶
func FormatMinutes ¶
FormatMinutes renders minutes as YouTrack shows durations without a work schedule: "1h 30m", "45m", "2h".
func Location ¶
Location returns the timezone that decides today's date for "auto": name when set (an IANA zone such as Europe/Madrid), otherwise fallback, the process timezone (which honours TZ). It mirrors workit, where the youtrack.json timezone wins over the process timezone.
func ParseDay ¶
ParseDay parses a YYYY-MM-DD day as midnight UTC. It rejects days that do not exist, such as 2026-02-30, and years outside 1970-9999.
func ParseDuration ¶
ParseDuration returns the minutes in a duration such as 1h30m, 90m, 1.5h, "1 hour 30 minutes" or a bare number of minutes (90). Parts add up and case is ignored, as in workit. The result must be a positive whole number of minutes. Days and weeks are refused: their length depends on the YouTrack instance's work schedule.
func WorkDate ¶
WorkDate resolves a work item date: "auto" (or "") is today's calendar day in loc at the instant now; otherwise raw is a YYYY-MM-DD day (one-digit months and days are accepted, as in workit). The result is that day at midnight UTC, which is how YouTrack stores a work item's date, so a given day is the same instant whatever timezone ytrack runs in.
Types ¶
This section is empty.