Help us shape the future of Go! Take the 2026 Go Developer Survey

reportday

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package reportday is the Report day of ADR 0057: a calendar day in the Workspace time zone. It loads the zone and cuts a trailing window of whole local days, so every report counts days the same way and a 23- or 25-hour day at a daylight-saving change is one bucket.

Index

Constants

View Source
const Format = "2006-01-02"

Format is the layout of a Report day's label.

Variables

View Source
var ErrUnknownZone = errors.New("unknown time zone")

ErrUnknownZone is a name the zone database does not know.

Functions

func Load

func Load(name string) (*time.Location, error)

Load is the zone an IANA name stands for. The empty name and "Local" (the machine's zone, which no Workspace may depend on) are refused like any unknown name.

func Location

func Location(name *string) (*time.Location, error)

Location is the zone named by a Workspace's timezone column; an unset one (nil) is UTC.

func Name

func Name(name *string) string

Name is the zone name a Workspace's timezone column stands for: UTC while unset.

Types

type Window

type Window struct {
	Loc          *time.Location
	Since, Until time.Time
	Dates        []string
}

Window is a run of whole Report days: Since is the first instant of the first day, Until the first instant after the last (exclusive), and Dates one label per day, oldest first.

func Trailing

func Trailing(now time.Time, loc *time.Location, days int) Window

Trailing is the last days Report days in loc, the one holding now included.

Jump to

Keyboard shortcuts

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