UNPKG

react-native-easy-calendar

Version:

Customizable, easy-to-use, performant calendar components for React Native

34 lines (27 loc) 669 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; // Inclusive range const getExtraDays = ({ from, to }) => { const days = []; const diff = from.diff(to, 'day'); // If 'to' date is before 'from' date, there are 0 slots available if (diff > 0) { return days; } /* * Start iteration from 0 to include 'from' day * Iterate until less than or equal to diff, to include 'to' day */ for (let i = 0; i <= Math.abs(diff); i += 1) { days.push(from.add(i, 'day')); } return days; }; var _default = getExtraDays; exports.default = _default; //# sourceMappingURL=getExtraDays.js.map