getMinutes.cjs 634 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. exports.getMinutes = getMinutes;
  3. var _index = require("./toDate.cjs");
  4. /**
  5. * The {@link getMinutes} function options.
  6. */
  7. /**
  8. * @name getMinutes
  9. * @category Minute Helpers
  10. * @summary Get the minutes of the given date.
  11. *
  12. * @description
  13. * Get the minutes of the given date.
  14. *
  15. * @param date - The given date
  16. * @param options - The options
  17. *
  18. * @returns The minutes
  19. *
  20. * @example
  21. * // Get the minutes of 29 February 2012 11:45:05:
  22. * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
  23. * //=> 45
  24. */
  25. function getMinutes(date, options) {
  26. return (0, _index.toDate)(date, options?.in).getMinutes();
  27. }