timeentry

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormatFull   = "2006-01-02 15:04:05"
	TimeFormatSimple = "15:04:05"
)

Variables

This section is empty.

Functions

func TimeEntriesCSVPrint

func TimeEntriesCSVPrint(timeEntries []dto.TimeEntry, out io.Writer) error

TimeEntriesCSVPrint will print each time entry using the format string

func TimeEntriesJSONPrint

func TimeEntriesJSONPrint(t []dto.TimeEntry, w io.Writer) error

TimeEntriesJSONPrint will print as JSON

func TimeEntriesMarkdownPrint

func TimeEntriesMarkdownPrint(tes []dto.TimeEntry, w io.Writer) error

TimeEntriesMarkdownPrint will print time entries in "markdown blocks"

func TimeEntriesPrint

func TimeEntriesPrint(opts ...TimeEntryOutputOpt) func([]dto.TimeEntry, io.Writer) error

TimeEntriesPrint will print more details

func TimeEntriesPrintQuietly

func TimeEntriesPrintQuietly(timeEntries []dto.TimeEntry, w io.Writer) error

TimeEntriesPrintQuietly will only print the IDs

func TimeEntriesPrintWithTemplate

func TimeEntriesPrintWithTemplate(
	format string,
) func([]dto.TimeEntry, io.Writer) error

TimeEntriesPrintWithTemplate will print each time entry using the format string

func TimeEntriesTotalDurationOnlyAsFloat

func TimeEntriesTotalDurationOnlyAsFloat(timeEntries []dto.TimeEntry, w io.Writer) error

TimeEntriesTotalDurationOnlyAsFloat will only print the total duration as float

func TimeEntriesTotalDurationOnlyFormatted

func TimeEntriesTotalDurationOnlyFormatted(
	timeEntries []dto.TimeEntry, w io.Writer) error

TimeEntriesTotalDurationOnlyFormatted will only print the total duration as float

func TimeEntryJSONPrint

func TimeEntryJSONPrint(t dto.TimeEntry, w io.Writer) error

TimeEntryJSONPrint will print as JSON

Types

type TimeEntryOutputOpt

type TimeEntryOutputOpt func(*TimeEntryOutputOptions) error

TimeEntryOutputOpt allows the setting of TimeEntryOutputOptions values

func WithShowTasks

func WithShowTasks() TimeEntryOutputOpt

WithShowTasks shows a new column with the task of the time entry

func WithTimeFormat

func WithTimeFormat(format string) TimeEntryOutputOpt

WithTimeFormat sets the date-time output format

func WithTotalDuration

func WithTotalDuration() TimeEntryOutputOpt

WithTotalDuration shows a footer with the sum of the durations of the time entries

type TimeEntryOutputOptions

type TimeEntryOutputOptions struct {
	ShowTasks         bool
	ShowTotalDuration bool
	TimeFormat        string
}

TimeEntryOutputOptions sets how the "table" format should print the time entries

Jump to

Keyboard shortcuts

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