From f463dd2755002127f45c5ecefeb9a51a5cf12857 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Thu, 20 Feb 2014 18:07:10 +0200 Subject: [PATCH] added *daily and *yearly for balance expiration time --- utils/coreutils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/coreutils.go b/utils/coreutils.go index 80ebb4d5b..ac033245a 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -135,8 +135,12 @@ func ParseDate(date string) (expDate time.Time, err error) { return expDate, err } expDate = time.Now().Add(d) + case date == "*daily": + expDate = time.Now().AddDate(0, 0, 1) // add one day case date == "*monthly": expDate = time.Now().AddDate(0, 1, 0) // add one month + case date == "*yearly": + expDate = time.Now().AddDate(1, 0, 0) // add one year case strings.HasSuffix(date, "Z"): expDate, err = time.Parse(time.RFC3339, date) default: