Documentation
¶
Index ¶
- Variables
- func Enabled(val bool) string
- func Float[T ~float32 | ~float64](val T) string
- func LocalTime(val any) string
- func Number[T ~int | ~int32 | ~uint | ~uint32 | ~int64 | ~uint64](val T) string
- func ParseStringTime(val string) time.Time
- func ParseTime(val any) time.Time
- func Time(val any) string
- func TimeAgo(val any) string
- func TimesElapsed(from, to any) (created string, updated string, elapsed string)
- func YesNo(val bool) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTimePrintFormat is the default time format: UTC, Local, Ago DefaultTimePrintFormat = "UTC" // DefaultTimeFormatZone is the default time format DefaultTimeFormatZone = "2006-01-02T15:04:05.999+07:00" // DefaultTimeFormatUTC is the default time format DefaultTimeFormatUTC = "2006-01-02T15:04:05.999Z" // DefaultTimeTruncate is the default time to truncate as Postgres time precision is default to 6 // However, JavaScript and AWS accept time milliseconds only, 3 digits, so we truncate to 3 DefaultTimeTruncate = time.Millisecond NowFunc = time.Now )
Functions ¶
func ParseStringTime ¶
ParseStringTime returns Time from a string
func TimesElapsed ¶
TimesElapsed returns formatted times and elapsed time
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.