timeentry

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 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(
	options TimeEntryOutputOptions) 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 TimeEntryOutputOptions

type TimeEntryOutputOptions struct {
	ShowTasks         bool
	ShowClients       bool
	ShowTotalDuration bool
	TimeFormat        string
}

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

func NewTimeEntryOutputOptions added in v0.51.0

func NewTimeEntryOutputOptions() TimeEntryOutputOptions

NewTimeEntryOutputOptions creates a default TimeEntryOutputOptions

func (TimeEntryOutputOptions) WithShowClients added in v0.51.0

func (teo TimeEntryOutputOptions) WithShowClients() TimeEntryOutputOptions

WithShowCliens shows a new column with the client of the time entry

func (TimeEntryOutputOptions) WithShowTasks added in v0.51.0

func (teo TimeEntryOutputOptions) WithShowTasks() TimeEntryOutputOptions

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

func (TimeEntryOutputOptions) WithTimeFormat added in v0.51.0

func (teo TimeEntryOutputOptions) WithTimeFormat(
	format string) TimeEntryOutputOptions

WithTimeFormat sets the date-time output format

func (TimeEntryOutputOptions) WithTotalDuration added in v0.51.0

func (teo TimeEntryOutputOptions) WithTotalDuration() TimeEntryOutputOptions

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

Jump to

Keyboard shortcuts

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