Function timeChunks

  • Generates an array of time intervals between two dates.

    Parameters

    • options: {
          boundary?: string;
          from: string | number;
          step: number;
          to: string | number;
      }

      Options for generating time intervals.

      • Optionalboundary?: string

        Restrict chunks to 'day', 'month', or 'day,month' boundaries.

      • from: string | number

        Start date in string format or as a UNIX timestamp.

      • step: number

        The step size in hours for each time interval.

      • to: string | number

        End date in string format or as a UNIX timestamp.

    Returns {
        from: string;
        step: number;
        to: string;
    }[]

    An array of objects representing each time interval.