Documentation
¶
Index ¶
- func FormatDuration(millis int64) string
- func FormatMillis(millis int64) string
- func FormatTime(t time.Time) string
- func MillisToTime(millis int64) time.Time
- func NowMillis() int64
- func PositionAfter(a string) string
- func PositionBefore(a string) string
- func PositionBetween(a, b string) string
- func PositionInitial(n int) []string
- func SlugWords(s string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶ added in v0.25.0
FormatDuration renders a millisecond duration as a coarse, single-unit, at-a-glance string (e.g. "just now", "5m", "3h", "2 days", "4 months"). Used for "how long in this column" displays where precision isn't the point.
func FormatMillis ¶
FormatMillis formats milliseconds since epoch in a human-readable way.
func FormatTime ¶
FormatTime formats a time in a human-readable way.
func MillisToTime ¶
MillisToTime converts milliseconds since Unix epoch to time.Time.
func NowMillis ¶
func NowMillis() int64
NowMillis returns the current time in milliseconds since Unix epoch.
func PositionAfter ¶ added in v0.21.0
PositionAfter returns a position that sorts after a. Shorthand for PositionBetween(a, "").
func PositionBefore ¶ added in v0.21.0
PositionBefore returns a position that sorts before a. Shorthand for PositionBetween("", a).
func PositionBetween ¶ added in v0.21.0
PositionBetween returns a position that sorts between a and b.
Pass "" for a to get a position before b (prepend to start of list). Pass "" for b to get a position after a (append to end of list). Both a and b empty returns a default starting position.
When both are provided, a must sort before b (a < b).
func PositionInitial ¶ added in v0.21.0
PositionInitial generates n evenly-spaced position strings. Useful for assigning initial positions when migrating existing card orderings.
Types ¶
This section is empty.