Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

28 строки
786 B

  1. import toDate from '../toDate/index.js';
  2. import requiredArgs from '../_lib/requiredArgs/index.js';
  3. /**
  4. * @name isMonday
  5. * @category Weekday Helpers
  6. * @summary Is the given date Monday?
  7. *
  8. * @description
  9. * Is the given date Monday?
  10. *
  11. * ### v2.0.0 breaking changes:
  12. *
  13. * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
  14. *
  15. * @param {Date|Number} date - the date to check
  16. * @returns {Boolean} the date is Monday
  17. * @throws {TypeError} 1 argument required
  18. *
  19. * @example
  20. * // Is 22 September 2014 Monday?
  21. * var result = isMonday(new Date(2014, 8, 22))
  22. * //=> true
  23. */
  24. export default function isMonday(dirtyDate) {
  25. requiredArgs(1, arguments);
  26. return toDate(dirtyDate).getDay() === 1;
  27. }