index.js 662 B

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