UNPKG

@functional-lib/kalendar

Version:

kalendar fp

25 lines (18 loc) 553 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.daysUntilMonday = exports.midnight = exports.clone = void 0; var clone = function clone(date) { return new Date(date); }; exports.clone = clone; var midnight = function midnight(date) { return new Date(date.setHours(0, 0, 0, 0)); }; exports.midnight = midnight; var daysUntilMonday = function daysUntilMonday(value) { return value.getDay() - (value.getDay() === 0 ? -6 : 1); }; exports.daysUntilMonday = daysUntilMonday; //# sourceMappingURL=date.js.map