From 7809b87367e8e49f6cfa17f4f22c257c23d7ca5c Mon Sep 17 00:00:00 2001
From: Jonas Franz <email@jfdev.de>
Date: Sun, 10 Sep 2017 19:09:56 +0200
Subject: [PATCH] Fixed filtering

Signed-off-by: Gitea <gitea@fake.local>
---
 models/replacement_lesson.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/models/replacement_lesson.go b/models/replacement_lesson.go
index 56f8388..ed4376a 100644
--- a/models/replacement_lesson.go
+++ b/models/replacement_lesson.go
@@ -93,13 +93,13 @@ func (opts *FindReplacementLessonsOptions) ToCond() builder.Cond {
 	cond := builder.NewCond()
 
 	if !opts.Date.IsZero() {
-		cond = cond.And(builder.Eq{"date_unix": opts.Date})
+		cond = cond.And(builder.Eq{"date_unix": opts.Date.Unix()})
 	} else {
 		if !opts.StartDate.IsZero() {
-			cond = cond.And(builder.Gte{"date_unix": opts.StartDate})
+			cond = cond.And(builder.Gte{"date_unix": opts.StartDate.Unix()})
 		}
 		if !opts.EndDate.IsZero() {
-			cond = cond.And(builder.Lte{"date_unix": opts.EndDate})
+			cond = cond.And(builder.Lte{"date_unix": opts.EndDate.Unix()})
 		}
 	}
 	return cond