diff pkg/models/import.go @ 2663:386ff766dfcd import-overview-rework

Replaced limit/offset filters with from/to as timestamps (format '2006-01-02T15:04:05.000').The output document also contains 'prev' and 'next' fields (if there is any matching data) from the times before and after 'from' and 'to'.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 14 Mar 2019 12:44:35 +0100
parents f90557a8c960
children 80bdcd137a1d
line wrap: on
line diff
--- a/pkg/models/import.go	Thu Mar 14 11:31:22 2019 +0100
+++ b/pkg/models/import.go	Thu Mar 14 12:44:35 2019 +0100
@@ -19,6 +19,8 @@
 	"time"
 )
 
+const ImportTimeFormat = "2006-01-02T15:04:05.000"
+
 type (
 	ImportTime struct{ time.Time }
 
@@ -62,7 +64,7 @@
 }
 
 func (it ImportTime) MarshalJSON() ([]byte, error) {
-	return json.Marshal(it.Format("2006-01-02T15:04:05.000"))
+	return json.Marshal(it.Format(ImportTimeFormat))
 }
 
 func (it *ImportTime) Scan(x interface{}) error {