vremel
Version:
JavaScript date utility library for Temporal API
12 lines • 587 B
JavaScript
/**
* Returns `Date` which represents exact time of the given temporal object.
*
* @param dateTime Temporal object which includes exact time info
* @param DateConstructor `Date` or extended class for return type, default is `Date`
* @returns `Date` (or its subclass) object which represents the exact time of the given Temporal object
*/
export function toDateFromExactTime(dateTime, DateConstructor) {
const DateConstructorFunction = DateConstructor ?? Date;
return new DateConstructorFunction(dateTime.epochMilliseconds);
}
//# sourceMappingURL=toDateFromExactTime.js.map