@abbl/material-calendar
Version:
Calendar component build with React and Material-UI
24 lines • 1.15 kB
JavaScript
var CalendarEventUtils = /** @class */ (function () {
function CalendarEventUtils() {
}
CalendarEventUtils.getDayEvents = function (eventStorage, date) {
var _a, _b;
return (_b = (_a = eventStorage === null || eventStorage === void 0 ? void 0 : eventStorage[date.getFullYear()]) === null || _a === void 0 ? void 0 : _a[date.getMonth()]) === null || _b === void 0 ? void 0 : _b[date.getDate()];
};
CalendarEventUtils.getMonthEvents = function (eventStorage, date) {
var _a;
var monthEvents = (_a = eventStorage === null || eventStorage === void 0 ? void 0 : eventStorage[date.getFullYear()]) === null || _a === void 0 ? void 0 : _a[date.getMonth()];
var calendarEvents = [];
if (monthEvents) {
for (var _i = 0, _b = Object.values(monthEvents); _i < _b.length; _i++) {
var day = _b[_i];
calendarEvents.push.apply(calendarEvents, day);
}
return calendarEvents;
}
return [];
};
return CalendarEventUtils;
}());
export default CalendarEventUtils;
//# sourceMappingURL=CalendarEventUtils.js.map