Documentation ¶
Index ¶
- func CreationDate(t time.Time) string
- func CreationDateRFC3339(str string) string
- func CreationDateTime(t time.Time) string
- func CreationDateTimeUnix(unix int64) string
- func CreationDateUnix(unix int64) string
- func Description(description string) string
- func Duration(duration time.Duration) string
- func DurationPT(pt string) string
- func DurationSeconds(duration time.Duration) string
- func Number(number uint64) string
- func ShortDescription(description string) string
- func Title(title string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreationDate ¶
CreationDate returns the `time.Time`'s date formatted in the `02 Jan 2006` format Example output: 02 Dec 2016
func CreationDateRFC3339 ¶
CreationDateRFC3339 parses the incoming string as an RFC3339-formatted date and then formats it into the `02 Jan 2006` format If the given string is not a valid RFC3339-formatted date, we will return an empty string Example output: 02 Dec 2016 See more: `CreationDate`
func CreationDateTime ¶
CreationDateTime returns the `time.Time`'s date formatted in the `02 Jan 2006 • 15:04 UTC` format Example output: 02 Jan 2006 • 15:04 UTC
func CreationDateTimeUnix ¶
CreationDateTimeUnix parses the incoming `int64` as a unix timestamp and then formats it with the CreationDateTime function Example output: 02 Jan 2006 • 15:04 UTC
func CreationDateUnix ¶
CreationDateUnix parses the incoming int64 as a unix timestamp and then returns the date in the `CreationDate` format. Example output: 02 Dec 2016 See more: `CreationDate`
func Description ¶
Description formats the input description into a consistent format. Current operations is just limiting the string to 200 characters
func Duration ¶
Duration takes a `time.Duration` and converts it to the nearest-second string output Example output: 01:59:59
func DurationPT ¶
DurationPT takes a PT-formatted string `time.Duration` and converts it to the nearest-second string output using the `Duration` helper Example output: 01:59:59 See also: Duration
func DurationSeconds ¶
DurationSeconds takes a `time.Duration` and converts it to a string in the following format: %gs where %g is the number of seconds contained within this duration Example output: 53s
func ShortDescription ¶
ShortDescription formats the input description as a short description. Example uses is the `description` key from the Wikipedia page summary API, where the summary for Forsen is "Swedish esports player and Twitch streamer" Current operations is just limiting the string to 60 characters
Types ¶
This section is empty.