diff options
Diffstat (limited to 'node_modules/date-fns/esm/endOfMinute/index.js')
| -rw-r--r-- | node_modules/date-fns/esm/endOfMinute/index.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/date-fns/esm/endOfMinute/index.js b/node_modules/date-fns/esm/endOfMinute/index.js new file mode 100644 index 0000000..6a05ce4 --- /dev/null +++ b/node_modules/date-fns/esm/endOfMinute/index.js @@ -0,0 +1,26 @@ +import toDate from "../toDate/index.js"; +import requiredArgs from "../_lib/requiredArgs/index.js"; +/** + * @name endOfMinute + * @category Minute Helpers + * @summary Return the end of a minute for the given date. + * + * @description + * Return the end of a minute for the given date. + * The result will be in the local timezone. + * + * @param {Date|Number} date - the original date + * @returns {Date} the end of a minute + * @throws {TypeError} 1 argument required + * + * @example + * // The end of a minute for 1 December 2014 22:15:45.400: + * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) + * //=> Mon Dec 01 2014 22:15:59.999 + */ +export default function endOfMinute(dirtyDate) { + requiredArgs(1, arguments); + var date = toDate(dirtyDate); + date.setSeconds(59, 999); + return date; +}
\ No newline at end of file |
