Documentation ¶
Index ¶
Constants ¶
const DateFmt = "2006-01-02"
DateFmt is a fairly standard, date-only format for times.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
func FormatDuration(duration time.Duration, timeFormat DurationFormat) string
FormatDuration returns the given time.Duration as a string in the given DurationFormat.
Types ¶
type DurationFormat ¶
type DurationFormat int
DurationFormat is an "enum" of the different display time formats. A DurationFormat can be used in conjunction with FormatDuration to control how some output duration is displayed.
const ( FormatDecimal DurationFormat = iota FormatText )
All possible duration formats.
func (*DurationFormat) UnmarshalTOML ¶
func (f *DurationFormat) UnmarshalTOML(bytes []byte) error
UnmarshalTOML takes a raw TOML time format value and attempts to parse the value as a DurationFormat. The value passed to this method should be a byte array of a quoted string (i.e. the raw TOML value), the method will remove the quotes.
type Weekday ¶
Weekday is a type used to extend the built-in 'time.Weekday' type to add new methods to help with things like parsing weekday strings into a stricter type.
All possible Weekday values.
func (Weekday) TimeWeekday ¶
TimeWeekday converts this Weekday to a standard library time.Weekday.
func (*Weekday) UnmarshalTOML ¶
UnmarshalTOML takes a raw TOML weekday string value and attempts to parse the value as a Weekday. The value passed to this method should be a byte array of a quoted string (i.e. the raw TOML value), the method will remove the quotes.