1
0
Fork 0
mirror of https://github.com/Luzifer/worktime.git synced 2024-12-22 22:11:16 +00:00
worktime/cmd/helpers.go
Knut Ahlers b6b5486cf0
Support "today" and "now" in date input
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-09-22 12:43:23 +02:00

11 lines
203 B
Go

package cmd
import "time"
func parseTime(format, input string) (time.Time, error) {
if input == "today" || input == "now" {
input = time.Now().Format(format)
}
return time.Parse(format, input)
}