daystr

package
v0.8.9-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurDayStr

func GetCurDayStr() string

func GetCustomDayStr

func GetCustomDayStr(format string) (string, error)

accepts a custom format string to return a daystr can be either a prefix, a delta, or a prefix w/ a delta if no prefix is given, "today" is assumed examples: today-2d, bow, bom+1m-1d (that's end of the month), 2024-04-01+1w

prefixes:

yyyy-mm-dd
today
yesterday
bom (beginning of month)
bow (beginning of week -- sunday)

deltas:

+[n]d, -[n]d (e.g. +1d, -5d)
+[n]w, -[n]w (e.g. +2w)
+[n]m, -[n]m (e.g. -1m)
deltas can be combined e.g. +1w-2d

func GetRelDayStr

func GetRelDayStr(relDays int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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