@technobuddha/library
Version:
A large library of useful functions
19 lines (18 loc) • 731 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMidnight = void 0;
/**
* Determine if a date is at midnight
*
* @param input A date
* @param __namedParamaters see {@link Options}
* @returns true, if the date is at midnight
*/
function isMidnight(input, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.UTC, UTC = _c === void 0 ? false : _c;
if (UTC)
return input.getUTCHours() === 0 && input.getUTCMinutes() === 0 && input.getUTCSeconds() === 0 && input.getUTCMilliseconds() === 0;
return input.getHours() === 0 && input.getMinutes() === 0 && input.getSeconds() === 0 && input.getMilliseconds() === 0;
}
exports.isMidnight = isMidnight;
exports.default = isMidnight;