master
Evan Chen 2022-01-09 01:05:42 +08:00
parent ce56a78f52
commit 3dabbb612f
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ func init() {
func ICS(cal_id string, from time.Time, to time.Time) (string, error) { func ICS(cal_id string, from time.Time, to time.Time) (string, error) {
cal := &Calendar{} cal := &Calendar{}
store.DB.Preload("Events", "start > ? and end < ?", from, to). store.DB.Preload("Events", `"start" > ? and "end" < ?`, from, to).
First(cal, "id = ?", cal_id) First(cal, "id = ?", cal_id)
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
if err := tmpl.Execute(buf, cal); err != nil { if err := tmpl.Execute(buf, cal); err != nil {