dates

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dates parses the human date and time forms the CLI accepts.

Every entry point takes an explicit "now" so callers are testable without mocking the clock.

Index

Constants

View Source
const NoneLiteral = "none"

NoneLiteral clears a nullable field. The API marks date, horizon, color and the foreign keys nullable, but there was previously no way to clear one from a flag: --date "" sends an empty string and is rejected.

Variables

This section is empty.

Functions

func Accepted

func Accepted() string

Accepted describes the grammar, for help text and error messages.

func IsNone

func IsNone(s string) bool

IsNone reports whether s asks to clear the field.

func ParseClock

func ParseClock(s string) (string, error)

ParseClock normalises a time of day to the "HH:MM" the API expects for start_time and end_time, which are format:time, not datetimes.

func ParseDate

func ParseDate(s string, now time.Time) (time.Time, error)

ParseDate resolves s to a local midnight.

Weekday rule: a bare "friday" means the next Friday *including today*, so typing it on a Friday means today rather than a week out. "next friday" is strictly after today and "last friday" strictly before.

Types

This section is empty.

Jump to

Keyboard shortcuts

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