diff --git a/dist/plan b/dist/plan index 5e9f417..eb2aaf0 100755 Binary files a/dist/plan and b/dist/plan differ diff --git a/plan/storage/sqlite/task.go b/plan/storage/sqlite/task.go index 5352f2e..919060c 100644 --- a/plan/storage/sqlite/task.go +++ b/plan/storage/sqlite/task.go @@ -69,21 +69,27 @@ func (t *SqliteTask) FindMany(params storage.TaskListParams) ([]item.Task, error args := []interface{}{} where := make([]string, 0) + var dateNonEmpty bool if params.HasRecurrer { where[0] = `recurrer != ''` } if !params.From.IsZero() { where = append(where, `date >= ?`) args = append(args, params.From.String()) + dateNonEmpty = true } if !params.To.IsZero() { where = append(where, `date <= ?`) args = append(args, params.To.String()) + dateNonEmpty = true } if params.Project != "" { where = append(where, `project = ?`) args = append(args, params.Project) } + if dateNonEmpty { + where = append(where, `date != ""`) + } if len(where) > 0 { query += ` WHERE ` + where[0]