Blame view

天文台pc/tianwentai-ui/node_modules/date-fns/eachWeekOfInterval.d.ts 1.48 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  import type {
    Interval,
    LocalizedOptions,
    StepOptions,
    WeekOptions,
  } from "./types.js";
  /**
   * The {@link eachWeekOfInterval} function options.
   */
  export interface EachWeekOfIntervalOptions
    extends StepOptions,
      WeekOptions,
      LocalizedOptions<"options"> {}
  /**
   * @name eachWeekOfInterval
   * @category Interval Helpers
   * @summary Return the array of weeks within the specified time interval.
   *
   * @description
   * Return the array of weeks within the specified time interval.
   *
   * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
   *
   * @param interval - The interval.
   * @param options - An object with options.
   *
   * @returns The array with starts of weeks from the week of the interval start to the week of the interval end
   *
   * @example
   * // Each week within interval 6 October 2014 - 23 November 2014:
   * const result = eachWeekOfInterval({
   *   start: new Date(2014, 9, 6),
   *   end: new Date(2014, 10, 23)
   * })
   * //=> [
   * //   Sun Oct 05 2014 00:00:00,
   * //   Sun Oct 12 2014 00:00:00,
   * //   Sun Oct 19 2014 00:00:00,
   * //   Sun Oct 26 2014 00:00:00,
   * //   Sun Nov 02 2014 00:00:00,
   * //   Sun Nov 09 2014 00:00:00,
   * //   Sun Nov 16 2014 00:00:00,
   * //   Sun Nov 23 2014 00:00:00
   * // ]
   */
  export declare function eachWeekOfInterval<DateType extends Date>(
    interval: Interval<DateType>,
    options?: EachWeekOfIntervalOptions,
  ): DateType[];