utils

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 9 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 FuzzySelectProject

func FuzzySelectProject(projects []types.Project, query string) (types.Project, error)

func FuzzySelectTask

func FuzzySelectTask(tasks []types.Task, projectColor project.Color, query string) (types.Task, error)

func GetProjectDescription

func GetProjectDescription(project types.Project) string

func GetTaskDescription

func GetTaskDescription(task types.Task, projectColor project.Color) string

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 tab-separated project data to stdout for non-interactive use.

func PrintTasksSimple added in v0.0.6

func PrintTasksSimple(tasks []types.Task)

PrintTasksSimple writes tab-separated task data to stdout for non-interactive use.

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