1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: use custom date for summary model to support sqlite deserialization

This commit is contained in:
Ferdinand Mütsch
2020-10-16 14:49:22 +02:00
parent f7520b2b4a
commit 67a59561c8
5 changed files with 27 additions and 27 deletions

View File

@ -64,11 +64,11 @@ func NewSummariesFrom(summaries []*models.Summary, filters *models.Filters) *Sum
for i, s := range summaries {
data[i] = newDataFrom(s)
if s.FromTime.Before(minDate) {
minDate = s.FromTime
if s.FromTime.T().Before(minDate) {
minDate = s.FromTime.T()
}
if s.ToTime.After(maxDate) {
maxDate = s.ToTime
if s.ToTime.T().After(maxDate) {
maxDate = s.ToTime.T()
}
}
@ -101,8 +101,8 @@ func newDataFrom(s *models.Summary) *summariesData {
},
Range: &summariesRange{
Date: time.Now().Format(time.RFC3339),
End: s.ToTime,
Start: s.FromTime,
End: s.ToTime.T(),
Start: s.FromTime.T(),
Text: "",
Timezone: zone,
},