@orange_digital/chakra-datepicker
Version:
A datepicker written for chakra-ui with chakra-ui
19 lines (18 loc) • 752 B
JavaScript
;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMonths = void 0;
function getMonths(date) {
var currentYear = date.getFullYear();
var currentDate = date.getDate();
return __spreadArray([], new Array(12), true).map(function (_, idx) { return new Date(currentYear, idx, currentDate); });
}
exports.getMonths = getMonths;