journal

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package journal resolves and creates periodic journal log files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoPeriodLogs

func AutoPeriodLogs(now time.Time, cfg *config.Config) []string

AutoPeriodLogs returns paths for period logs (weekly, monthly, yearly) that should be auto-opened because today is the start of that period and the relevant template exists. Returns nil when cfg.AutoJournalPeriods is false.

func GetLog

func GetLog(date time.Time, period Period, cfg *config.Config) (string, error)

GetLog returns the path to the log for the given date and period, creating it if needed.

func ReviewPaths

func ReviewPaths(now time.Time, period Period, cfg *config.Config) ([]string, error)

ReviewPaths returns the set of files relevant to reviewing the given period.

Types

type Period

type Period int

Period represents the granularity of a journal log.

const (
	Daily Period = iota
	Weekly
	Monthly
	Yearly
)

Available journal periods.

func ParsePeriod

func ParsePeriod(s string) (Period, error)

ParsePeriod converts a user-facing string to a Period.

func ParseRef

func ParseRef(ref string, now time.Time, weekStart string) (time.Time, Period, error)

ParseRef converts a relative reference (e.g. "today", "last-week", "this month") or an absolute date reference (e.g. "2026-W03", "2026-03-15", "2026-03", "2026") to a date and period. weekStart ("monday" or "sunday") governs weekly numbering.

Jump to

Keyboard shortcuts

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