mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
added *daily and *yearly for balance expiration time
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user