Docs docs docs

This commit is contained in:
Philipp Heckel 2021-12-11 00:06:25 -05:00
parent e8688fed4b
commit 01d21165e9
5 changed files with 101 additions and 10 deletions

View file

@ -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)