diff --git a/apier/v1/stats_it_test.go b/apier/v1/stats_it_test.go index ce5566b6b..55ba3e544 100644 --- a/apier/v1/stats_it_test.go +++ b/apier/v1/stats_it_test.go @@ -279,8 +279,8 @@ func testV1STSSetStatQueueProfile(t *testing.T) { ID: "TEST_PROFILE1", FilterIDs: []string{"FLTR_1"}, ActivationInterval: &utils.ActivationInterval{ - ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC).Local(), - ExpiryTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC).Local(), + ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC), + ExpiryTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC), }, QueueLength: 10, TTL: time.Duration(10) * time.Second, diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index 26cefe23f..762c99c19 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -356,8 +356,8 @@ func testV1TSSetThresholdProfile(t *testing.T) { ID: "TEST_PROFILE1", FilterIDs: []string{"FilterID1", "FilterID2"}, ActivationInterval: &utils.ActivationInterval{ - ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC).Local(), - ExpiryTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC).Local(), + ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC), + ExpiryTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC), }, Recurrent: true, MinSleep: time.Duration(5 * time.Minute), diff --git a/utils/cgrevent.go b/utils/cgrevent.go index 55b91b708..eee4b05d7 100644 --- a/utils/cgrevent.go +++ b/utils/cgrevent.go @@ -84,6 +84,9 @@ func (ev *CGREvent) FieldAsDuration(fldName string) (d time.Duration, err error) if d, canCast = iface.(time.Duration); canCast { return } + if f, canCast := iface.(float64); canCast { + return time.Duration(int64(f)), nil + } s, canCast := iface.(string) if !canCast { err = fmt.Errorf("cannot cast %s to string", fldName)