index.js 628 B

1234567891011121314151617181920212223
  1. var isSameHour = require('../is_same_hour/index.js')
  2. /**
  3. * @category Hour Helpers
  4. * @summary Is the given date in the same hour as the current date?
  5. *
  6. * @description
  7. * Is the given date in the same hour as the current date?
  8. *
  9. * @param {Date|String|Number} date - the date to check
  10. * @returns {Boolean} the date is in this hour
  11. *
  12. * @example
  13. * // If now is 25 September 2014 18:30:15.500,
  14. * // is 25 September 2014 18:00:00 in this hour?
  15. * var result = isThisHour(new Date(2014, 8, 25, 18))
  16. * //=> true
  17. */
  18. function isThisHour (dirtyDate) {
  19. return isSameHour(new Date(), dirtyDate)
  20. }
  21. module.exports = isThisHour