index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isSaturday;
  6. var _index = _interopRequireDefault(require("../toDate/index.js"));
  7. var _index2 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. /**
  10. * @name isSaturday
  11. * @category Weekday Helpers
  12. * @summary Is the given date Saturday?
  13. *
  14. * @description
  15. * Is the given date Saturday?
  16. *
  17. * ### v2.0.0 breaking changes:
  18. *
  19. * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
  20. *
  21. * @param {Date|Number} date - the date to check
  22. * @returns {Boolean} the date is Saturday
  23. * @throws {TypeError} 1 argument required
  24. *
  25. * @example
  26. * // Is 27 September 2014 Saturday?
  27. * var result = isSaturday(new Date(2014, 8, 27))
  28. * //=> true
  29. */
  30. function isSaturday(dirtyDate) {
  31. (0, _index2.default)(1, arguments);
  32. return (0, _index.default)(dirtyDate).getDay() === 6;
  33. }
  34. module.exports = exports.default;