How to use the react-big-calendar/lib/utils/dates.firstVisibleDay function in react-big-calendar

To help you get started, we’ve selected a few react-big-calendar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant-polymer / src / panels / calendar / ha-panel-calendar.js View on Github external
_fetchData() {
    const start = dates.firstVisibleDay(this.currentDate).toISOString();
    const end = dates.lastVisibleDay(this.currentDate).toISOString();
    const params = encodeURI(`?start=${start}&end=${end}`);
    const calls = this.selectedCalendars.map((cal) =>
      this.hass.callApi("get", `calendars/${cal}${params}`)
    );
    Promise.all(calls).then((results) => {
      const tmpEvents = [];

      results.forEach((res) => {
        res.forEach((ev) => {
          ev.start = new Date(ev.start);
          if (ev.end) {
            ev.end = new Date(ev.end);
          } else {
            ev.end = null;
          }