timesheet

package
v0.0.0-...-2c0f2d8 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sheet

type Sheet struct {
	DateFormat string // Format used to write and parse dates.
	TimeFormat string // Format used to write and parse times.
	Times      []time.Time
}

Sheet contains the list of times in the timesheet.

func Load

func Load(r io.Reader, dateFormat, timeFormat string) (*Sheet, error)

Load initializes a timesheet from the supplied reader.

func (*Sheet) End

func (s *Sheet) End(end time.Time) error

End adds the given time to the sheet as end time.

func (*Sheet) Print

func (s *Sheet) Print(roundTo time.Duration, w io.Writer)

Print writes the complete timesheet to the supplied writer.

func (*Sheet) PrintMonth

func (s *Sheet) PrintMonth(month time.Month, roundTo time.Duration, w io.Writer)

PrintMonth writes the given month to the supplied writer.

func (*Sheet) Save

func (s *Sheet) Save(w io.Writer) error

Save writes the timesheet to the supplied writer.

func (*Sheet) Start

func (s *Sheet) Start(start time.Time) error

Start adds the given time to the sheet as start time.

Jump to

Keyboard shortcuts

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