Documentation ¶
Index ¶
Constants ¶
View Source
const ( FullTimeFormat = "2006-01-02 15:04:05" SimplerTimeFormat = "2006-01-02 15:04" OnlyTimeFormat = "15:04:05" SimplerOnlyTimeFormat = "15:04" NowTimeFormat = "now" )
Variables ¶
View Source
var ErrInvalidReliveTime = errors.New(
"supported relative time formats are: " +
"+15:04:05, +15:04 or unit descriptive +1d15h4m5s, " +
"+15h5s, 120m",
)
Functions ¶
func ConvertToTime ¶
ConvertToTime will try to convert a string do time.Time looking for the format that best fits it and assuming "today" when necessary. If the string starts with `yesterday`, than it will be exchanged for a date-string with the format: 2006-01-02 If the string starts with `+` or `-` than the string will be treated as "relative time expressions", and will be calculated as the diff from now and it. If the string is "now" than `time.Now()` in the local timezone will be returned.
func GetMonthRange ¶
GetMonthRange given a time it returns the first and last date of a month
func GetWeekRange ¶
GetWeekRange given a time it returns the first and last date of a week
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.