reports

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Example (Dur)

Fix https://github.com/fractalqb/tiktak/issues/3

d := 48*time.Minute + 5*time.Second + 714286*time.Microsecond
fmt.Println(fmtDuration(d))
d = 8*time.Hour + 30*time.Minute + 8*time.Second + 571429*time.Microsecond
fmt.Println(fmtDuration(d))
Output:

48'05.714"
08:30'08.571"

Index

Examples

Constants

View Source
const (
	DateFmt      = "Mon, 02 Jan 2006"
	ShortDateFmt = "Mon, 02 Jan"
)

Variables

View Source
var (
	MinutesFmts = cfgFmts{
				// contains filtered or unexported fields
	}

	SecondsFmts = cfgFmts{
				// contains filtered or unexported fields
	}

	FracCFmts = cfgFmts{
				// contains filtered or unexported fields
	}
)

Functions

func Bold

func Bold() tiktbl.Styler

func Muted

func Muted() tiktbl.Styler

func ParseSpanID added in v0.3.1

func ParseSpanID(s string) (int, error)
Example
for _, id := range []string{"2", "4", "G", "74", "1EkG"} {
	fmt.Println(ParseSpanID(id))
}
Output:

2 <nil>
4 <nil>
16 <nil>
256 <nil>
65536 <nil>

func SpanID added in v0.3.1

func SpanID(idx int) string
Example
for i := 2; i < 65537; i = i * i {
	fmt.Println(i, SpanID(i))
}
Output:

2 2
4 4
16 G
256 74
65536 1EKG

func Underline

func Underline() tiktbl.Styler

func Warn

func Warn() tiktbl.Styler

Types

type Formats

type Formats interface {
	Date(time.Time) string
	ShortDate(time.Time) string
	Clock(time.Time) string
	Duration(time.Duration) string
}

type Report

type Report struct {
	Layout tiktbl.Writer
	Fmts   Formats
}

type Sheet

type Sheet struct {
	Report
	WeekStart time.Weekday
	Tasks     []*tiktak.Task
}

func (*Sheet) Write

func (sht *Sheet) Write(w io.Writer, tl tiktak.TimeLine, now time.Time)

type Spans

type Spans struct {
	Report
	Verbose bool
}

func (*Spans) Write

func (spans *Spans) Write(w io.Writer, tl tiktak.TimeLine, now time.Time)

type Sums

type Sums struct {
	Report
	WeekStart time.Weekday
}

func (*Sums) Write

func (sm *Sums) Write(w io.Writer, tl tiktak.TimeLine, now time.Time)

type TaskSums

type TaskSums struct {
	Day1, DaySub     string
	Week1, WeekSub   string
	Month1, MonthSub string
	Open             bool
	// contains filtered or unexported fields
}

func NewTaskSums

func NewTaskSums(now time.Time, sow time.Weekday) *TaskSums

func (*TaskSums) Of

func (ts *TaskSums) Of(tl tiktak.TimeLine, t *tiktak.Task, fmts Formats)

Jump to

Keyboard shortcuts

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