report

package
v0.0.0-...-9d8fcc8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportDailyCSV

func ExportDailyCSV(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) string

ExportDailyCSV generates CSV content for a single day.

func ExportMonthlyCSV

func ExportMonthlyCSV(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) string

ExportMonthlyCSV generates CSV content for the month containing date.

func ExportWeeklyCSV

func ExportWeeklyCSV(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) string

ExportWeeklyCSV generates CSV content for the ISO week containing date.

func FormatReport

func FormatReport(r Report) string

FormatReport formats a report as human-readable text.

func WriteCSV

func WriteCSV(content string, filePath string) error

WriteCSV writes CSV content to a file, creating parent directories if needed.

Types

type Report

type Report struct {
	Period     string
	DateRange  string
	Items      []ReportItem
	TotalWork  time.Duration
	TotalSlack time.Duration
}

Report represents a generated time report.

func GenerateDailyReport

func GenerateDailyReport(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) Report

GenerateDailyReport creates a report for a single day.

func GenerateMonthlyReport

func GenerateMonthlyReport(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) Report

GenerateMonthlyReport creates a report for the month containing date.

func GenerateWeeklyReport

func GenerateWeeklyReport(entries []timelog.Entry, date time.Time, virtualMidnight time.Duration) Report

GenerateWeeklyReport creates a report for the ISO week containing date.

type ReportItem

type ReportItem struct {
	Category    string
	Description string
	Duration    time.Duration
}

ReportItem is a single line in a report.

Jump to

Keyboard shortcuts

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