UNPKG

732 BJavaScriptView Raw
1"use strict";
2exports.nextSaturday = nextSaturday;
3var _index = require("./nextDay.js");
4
5/**
6 * @name nextSaturday
7 * @category Weekday Helpers
8 * @summary When is the next Saturday?
9 *
10 * @description
11 * When is the next Saturday?
12 *
13 * @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).
14 *
15 * @param date - The date to start counting from
16 *
17 * @returns The next Saturday
18 *
19 * @example
20 * // When is the next Saturday after Mar, 22, 2020?
21 * const result = nextSaturday(new Date(2020, 2, 22))
22 * //=> Sat Mar 28 2020 00:00:00
23 */
24function nextSaturday(date) {
25 return (0, _index.nextDay)(date, 6);
26}