Skip to content

Commit

Permalink
fix: all day event datetime parsing (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmartingr authored Dec 18, 2023
1 parent e6160d6 commit 49af9f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcal/get_default_calendar_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ func (c *client) GetDefaultCalendarView(_ string, start, end time.Time) ([]*remo
}

func convertGCalEventDateTimeToRemoteDateTime(dt *calendar.EventDateTime) *remote.DateTime {
// Handle all-day events
if len(dt.Date) > 0 {
t, _ := time.Parse("2006-01-02", dt.Date)
return remote.NewDateTime(t.UTC(), "UTC")
}

t, _ := time.Parse(time.RFC3339, dt.DateTime)
return remote.NewDateTime(t.UTC(), "UTC")
}
Expand Down

0 comments on commit 49af9f0

Please sign in to comment.