index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = nextWednesday;
  6. var _index = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
  7. var _index2 = _interopRequireDefault(require("../nextDay/index.js"));
  8. var _index3 = _interopRequireDefault(require("../toDate/index.js"));
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. /**
  11. * @name nextWednesday
  12. * @category Weekday Helpers
  13. * @summary When is the next Wednesday?
  14. *
  15. * @description
  16. * When is the next Wednesday?
  17. *
  18. * @param {Date | number} date - the date to start counting from
  19. * @returns {Date} the next Wednesday
  20. * @throws {TypeError} 1 argument required
  21. *
  22. * @example
  23. * // When is the next Wednesday after Mar, 22, 2020?
  24. * const result = nextWednesday(new Date(2020, 2, 22))
  25. * //=> Wed Mar 25 2020 00:00:00
  26. */
  27. function nextWednesday(date) {
  28. (0, _index.default)(1, arguments);
  29. return (0, _index2.default)((0, _index3.default)(date), 3);
  30. }
  31. module.exports = exports.default;