index.js 556 B

123456789101112131415161718192021222324
  1. var parse = require('../parse/index.js')
  2. /**
  3. * @category Minute Helpers
  4. * @summary Get the minutes of the given date.
  5. *
  6. * @description
  7. * Get the minutes of the given date.
  8. *
  9. * @param {Date|String|Number} date - the given date
  10. * @returns {Number} the minutes
  11. *
  12. * @example
  13. * // Get the minutes of 29 February 2012 11:45:05:
  14. * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
  15. * //=> 45
  16. */
  17. function getMinutes (dirtyDate) {
  18. var date = parse(dirtyDate)
  19. var minutes = date.getMinutes()
  20. return minutes
  21. }
  22. module.exports = getMinutes