utils

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDuration = 1 * time.Hour

Functions

func ComputeFields added in v0.0.6

func ComputeFields(t *types.Task)

ComputeFields populates all computed fields on a task before output.

func LoadClient

func LoadClient() (api.Client, error)

func ParseFlexibleTime added in v0.0.6

func ParseFlexibleTime(value string) (time.Time, error)

ParseFlexibleTime parses time values in multiple formats: - ISO 8601 with timezone (e.g. 2025-02-18T15:04:05+02:00) - ISO 8601 with compact offset (e.g. 2025-02-18T15:04:05+0200) - Plain date (e.g. 2025-02-18); treated as midnight local time - Natural language (e.g. "tomorrow", "next friday 5pm"); returns start of the parsed range

func ParseTimeExpression

func ParseTimeExpression(expr string) (*naturaltime.Range, error)

func PrintProjectsSimple added in v0.0.6

func PrintProjectsSimple(projects []types.Project)

PrintProjectsSimple writes styled project data to stdout for non-interactive use. When piped (non-TTY), falls back to tab-separated format for scripting.

func PrintTasksSimple added in v0.0.6

func PrintTasksSimple(tasks []types.Task)

PrintTasksSimple writes styled task data to stdout for non-interactive use. When piped (non-TTY), falls back to tab-separated format for scripting.

func TruncateToDate added in v0.0.6

func TruncateToDate(t time.Time) time.Time

TruncateToDate strips the time component, keeping only the date at midnight.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL