helper

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConformTimestamp

func ConformTimestamp(timestamp string) (*time.Time, error)

ConformTimestamp converts an RFC3339 timestamp string to a `time.Time`

func DaysBetweenDates

func DaysBetweenDates(a time.Time, b time.Time) float64

DaysBetweenDates calculates the number of days between two dates

func FormatMoney

func FormatMoney(value float64, precision int) string

func PopString

func PopString(str string, sep string) string

PopString splits a string on a given separator and returns end element

func PrettyDate

func PrettyDate(timestamp string) string

PrettyDate formats a RFC3339 date string to be pretty

func Round

func Round(value float64) float64

Round rounds a number to the nearest 2 decimals

func SubtractDaysFromDate

func SubtractDaysFromDate(date time.Time, days int) time.Time

SubtractDaysFromDate subtracts given days from given date and returns date

func Truncate

func Truncate(str string, length int, suffix string) string

Truncate truncates a string to a given `length` and appends an optional `suffix`

Types

This section is empty.

Jump to

Keyboard shortcuts

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