UNPKG

723 BJavaScriptView Raw
1"use strict";
2exports.nextTuesday = nextTuesday;
3var _index = require("./nextDay.js");
4
5/**
6 * @name nextTuesday
7 * @category Weekday Helpers
8 * @summary When is the next Tuesday?
9 *
10 * @description
11 * When is the next Tuesday?
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 Tuesday
18 *
19 * @example
20 * // When is the next Tuesday after Mar, 22, 2020?
21 * const result = nextTuesday(new Date(2020, 2, 22))
22 * //=> Tue Mar 24 2020 00:00:00
23 */
24function nextTuesday(date) {
25 return (0, _index.nextDay)(date, 2);
26}