Docs docs docs
This commit is contained in:
parent
e8688fed4b
commit
01d21165e9
5 changed files with 101 additions and 10 deletions
|
@ -14,6 +14,8 @@ var (
|
|||
durationStrRegex = regexp.MustCompile(`(?i)^(\d+)\s*(d|days?|h|hours?|m|mins?|minutes?|s|secs?|seconds?)$`)
|
||||
)
|
||||
|
||||
// ParseFutureTime parses a date/time string to a time.Time. It supports unix timestamps, durations
|
||||
// and natural language dates
|
||||
func ParseFutureTime(s string, now time.Time) (time.Time, error) {
|
||||
s = strings.TrimSpace(s)
|
||||
t, err := parseUnixTime(s, now)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue