UNPKG

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