Function useCalendar

  • Load calendar events by calendar ID, limited by given start and end dates.

    const TodaysEvents = () => {
    const today = new Date()
    const { data } = useCalendar('calendar.main', { start: startOfDay(date), end: endOfDay(date) })
    return <pre>{JSON.stringify(data)}</pre>
    }

    Type Parameters

    Parameters

    • calendarId: string

      full calendar ID as displayed in Homeassistant

    • options: {
          end: Date;
          start: Date;
      } & Partial<PublicConfiguration<TResponse, unknown, BareFetcher<TResponse>>>

      Other options passed to SWR. See https://swr.vercel.app/docs/api#options

    Returns SWRResponse<TResponse, any, undefined | Partial<PublicConfiguration<TResponse, any, BareFetcher<TResponse>>>>

Generated using TypeDoc