vremel
Version:
JavaScript date utility library for Temporal API
20 lines • 635 B
JavaScript
import { isZonedDateTime } from "../type-utils.js";
import { endOfTimeForZonedDateTime } from "./_endOfTimeForZonedDateTime.js";
/**
* Returns the end of a minute for the given datetime
* @param dt datetime object which includes time info
* @returns Temporal object which represents the end of the minute
*/
export function endOfMinute(dt) {
const withArg = {
second: 59,
millisecond: 999,
microsecond: 999,
nanosecond: 999,
};
if (!isZonedDateTime(dt)) {
return dt.with(withArg);
}
return endOfTimeForZonedDateTime(dt, withArg);
}
//# sourceMappingURL=endOfMinute.js.map