From b5c4204c38e83b9faa20b4f0f320421ef7f2ae86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Thu, 15 Oct 2020 22:44:55 +0100 Subject: [PATCH] Sorted ListEntries --- z/database.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/z/database.go b/z/database.go index e955eb1..a8776f8 100644 --- a/z/database.go +++ b/z/database.go @@ -2,6 +2,7 @@ package z import ( "os" + "sort" "log" "errors" "encoding/json" @@ -147,5 +148,6 @@ func (database *Database) ListEntries(user string) ([]Entry, error) { return nil }) + sort.Slice(entries, func(i, j int) bool { return entries[i].Begin.Before(entries[j].Begin) }) return entries, dberr }