yats.git

commit e6ce5ae3b106649644dc07173edf7534baa9e533

Author: Paolo Lulli <paolo@lulli.net>

Substring filter

 server/rest/rest-metric.go | 4 ++--


diff --git a/server/rest/rest-metric.go b/server/rest/rest-metric.go
index 9b03ce390b26b980ba7e8cf461fdebffaa4f35bf..063a91f22e2163a2966e187639f90eebd5ca5356 100644
--- a/server/rest/rest-metric.go
+++ b/server/rest/rest-metric.go
@@ -101,8 +101,8 @@ 		var metricsPack []model.MetricModel
 
 		if metric.To == 0 {
 			unixTimeUTC := time.Unix(metric.From, 0)
-			timeAsBytes := unixTimeUTC.UTC().String()
-			metricsPack = db.MetricsFrom(db.Session, clientCN, metric.Name, timeAsBytes, 100)
+			timeString := unixTimeUTC.UTC().String()
+			metricsPack = db.MetricsFrom(db.Session, clientCN, metric.Name, strings.TrimSpace(timeString[0:19]), 100)
 		} else if metric.From != 0 {
 			fromUnixTimeUTC := time.Unix(metric.From, 0)
 			toUnixTimeUTC := time.Unix(metric.To, 0)