UNPKG

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