UNPKG

687 BJavaScriptView Raw
1"use strict";
2exports.isThursday = isThursday;
3var _index = require("./toDate.js");
4
5/**
6 * @name isThursday
7 * @category Weekday Helpers
8 * @summary Is the given date Thursday?
9 *
10 * @description
11 * Is the given date 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 check
16 *
17 * @returns The date is Thursday
18 *
19 * @example
20 * // Is 25 September 2014 Thursday?
21 * const result = isThursday(new Date(2014, 8, 25))
22 * //=> true
23 */
24function isThursday(date) {
25 return (0, _index.toDate)(date).getDay() === 4;
26}