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

28 строки
807 B

  1. import toDate from '../toDate/index.js';
  2. import requiredArgs from '../_lib/requiredArgs/index.js';
  3. /**
  4. * @name isWednesday
  5. * @category Weekday Helpers
  6. * @summary Is the given date Wednesday?
  7. *
  8. * @description
  9. * Is the given date Wednesday?
  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 Wednesday
  17. * @throws {TypeError} 1 argument required
  18. *
  19. * @example
  20. * // Is 24 September 2014 Wednesday?
  21. * var result = isWednesday(new Date(2014, 8, 24))
  22. * //=> true
  23. */
  24. export default function isWednesday(dirtyDate) {
  25. requiredArgs(1, arguments);
  26. return toDate(dirtyDate).getDay() === 3;
  27. }