index.js 654 B

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