Documentation
¶
Index ¶
- Constants
- Variables
- func AfterOrEqual(t1, t2 time.Time) bool
- func AllBoxesFromDB(tbdb db.TBDB) ([]string, map[string]Box)
- func AllSpansFromDB(tbdb db.TBDB) (map[string]SpanSet, map[int64]Span)
- func BeforeOrEqual(t1, t2 time.Time) bool
- func DurationParser(d time.Duration) string
- func Earlier(t1, t2 time.Time) time.Time
- func FiscalQuarter(fiscalYearStart, calendarMonth time.Month) int
- func Later(t1, t2 time.Time) time.Time
- func MonthStart(t time.Time) time.Time
- func ParseDurationOrTime(s string) (time.Time, error)
- func ParseTime(s string) (time.Time, error)
- func QuarterStart(t time.Time, fys time.Month) time.Time
- func ThisMonthStart() time.Time
- func ThisQuarterStart(fys time.Month) time.Time
- func ThisWeekStart() time.Time
- func ThisYearStart() time.Time
- func WeekStart(t time.Time) time.Time
- func YearStart(t time.Time) time.Time
- type Box
- type BoxSpec
- type InputResult
- type Period
- type PromptState
- type Span
- type SpanSet
- type TimeBox
- func (tb TimeBox) AddBox(box Box) error
- func (tb TimeBox) AddSpan(span Span, box string) error
- func (tb TimeBox) DeleteBox(box string) error
- func (tb TimeBox) DeleteBoxAndSpans(box string) error
- func (tb TimeBox) DeleteSpan(span Span) error
- func (tb TimeBox) DeleteSpanByID(id int64) error
- func (tb TimeBox) GetSpans(span Span) map[string]SpanSet
- func (tb TimeBox) GetSpansForBox(box string, span Span) SpanSet
- func (tb TimeBox) GetSpansForTimespan(span Span) SpanSet
- func (tb TimeBox) SyncFromDB()
- func (tb TimeBox) UpdateBox(box Box) error
- func (tb TimeBox) UpdateSpan(span Span) error
- type TimePeriod
Constants ¶
View Source
const ( ColorDurationHours = "#FF0087" ColorDurationMinutes = "#00D7FF" ColorDurationSeconds = "#FFFF5F" ColorPeriodForeground = "#BAEBDA" ColorPeriodHighlight = "#DE3E93" )
Variables ¶
View Source
var CurrentPeriodStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(ColorPeriodForeground)). Background(lipgloss.Color(ColorPeriodHighlight)). Padding(0, 1)
View Source
var DurationHourStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(ColorDurationHours)). Render
View Source
var DurationMinuteStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(ColorDurationMinutes)). Render
View Source
var DurationSecondStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(ColorDurationSeconds)). Render
View Source
var PeriodPickerStyle = lipgloss.NewStyle(). PaddingRight(1). Align(lipgloss.Right)
View Source
var PeriodStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color(ColorPeriodForeground)). Padding(0, 1)
View Source
var TypicalBoxSpecs = map[string]BoxSpec{ "Work": { Name: "Work", Min: time.Hour * 35, Max: time.Hour * 50, SpanMin: time.Hour * 6, SpanMax: time.Hour * 9, HourMin: 8, HourMax: 18, AllowedDays: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday}, }, "Exercise": { Name: "Exercise", Min: time.Hour * 2, Max: time.Hour * 8, SpanMin: time.Minute * 30, SpanMax: time.Hour * 2, HourMin: 5, HourMax: 8, AllowedDays: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday, time.Saturday, time.Sunday}, }, "Piano": { Name: "Piano", Min: time.Hour * 1, Max: time.Hour * 10, SpanMin: time.Minute * 30, SpanMax: time.Minute * 60, HourMin: 17, HourMax: 22, AllowedDays: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday, time.Saturday, time.Sunday}, }, "Reading": { Name: "Reading", Min: time.Hour * 1, Max: time.Hour * 10, SpanMin: time.Minute * 15, SpanMax: time.Minute * 90, HourMin: 17, HourMax: 22, AllowedDays: []time.Weekday{time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday, time.Saturday, time.Sunday}, }, "Hiking": { Name: "Hiking", Min: time.Hour * 1, Max: time.Hour * 5, SpanMin: time.Hour * 1, SpanMax: time.Hour * 5, HourMin: 5, HourMax: 12, AllowedDays: []time.Weekday{time.Saturday, time.Sunday}, }, }
Functions ¶
func AfterOrEqual ¶
func BeforeOrEqual ¶
func DurationParser ¶
func FiscalQuarter ¶
func MonthStart ¶
MonthStart calculates the time at the beginning of the month for a given time
func ThisMonthStart ¶
ThisMonthStart calculates the time at the beginning of the current month
func ThisWeekStart ¶
ThisWeekStart calculates the time at the beginning of the current week
func ThisYearStart ¶
ThisYearStart calculates the time at the beginning of the current year
Types ¶
type BoxSpec ¶
type InputResult ¶
type InputResult struct {
// contains filtered or unexported fields
}
func NewInputResultBox ¶
func NewInputResultBox(box Box) InputResult
func NewInputResultSpan ¶
func NewInputResultSpan(span Span) InputResult
func (InputResult) Box ¶
func (r InputResult) Box() Box
func (InputResult) IsBox ¶
func (r InputResult) IsBox() bool
func (InputResult) Span ¶
func (r InputResult) Span() Span
type Span ¶
func MonthSoFar ¶
func MonthSoFar() Span
func QuarterSoFar ¶
func (Span) GetOverlap ¶
type SpanSet ¶
type SpanSet struct { Spans []Span // list for table loads // contains filtered or unexported fields }
func NewSpanSet ¶
func NewSpanSet() SpanSet
type TimeBox ¶
type TimeBox struct { Fname string Names []string Boxes map[string]Box SpansSets map[string]SpanSet Spans map[int64]Span // contains filtered or unexported fields }
func TimeBoxFromDB ¶
func (TimeBox) DeleteBoxAndSpans ¶
func (TimeBox) DeleteSpan ¶
func (TimeBox) DeleteSpanByID ¶
func (TimeBox) GetSpansForTimespan ¶
func (TimeBox) SyncFromDB ¶
func (tb TimeBox) SyncFromDB()
func (TimeBox) UpdateSpan ¶
type TimePeriod ¶
type TimePeriod struct {
Period
}
func (*TimePeriod) Current ¶
func (t *TimePeriod) Current() int
func (*TimePeriod) Names ¶
func (t *TimePeriod) Names() []string
func (*TimePeriod) Next ¶
func (t *TimePeriod) Next()
func (*TimePeriod) Previous ¶
func (t *TimePeriod) Previous()
func (*TimePeriod) String ¶
func (t *TimePeriod) String() string
func (*TimePeriod) View ¶
func (t *TimePeriod) View() string
Click to show internal directories.
Click to hide internal directories.