devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
30 lines (29 loc) • 1.05 kB
JavaScript
/**
* DevExtreme (esm/__internal/scheduler/appointments/utils/countVisibleAppointments.js)
* Version: 25.1.3
* Build date: Wed Jun 25 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
isDefined
} from "../../../core/utils/m_type";
const countVisibleRepeats = settings => {
let isPreviousPart = false;
return settings.reduce(((total, settingsItem) => {
const result = isPreviousPart ? total : total + 1;
const {
partIndex: partIndex,
partTotalCount: partTotalCount
} = settingsItem;
isPreviousPart = isDefined(partTotalCount) && partIndex !== partTotalCount - 1;
return result
}), 0)
};
export const countVisibleAppointments = items => items.filter((_ref => {
let {
needRemove: needRemove
} = _ref;
return !needRemove
})).reduce(((total, item) => total + countVisibleRepeats(item.settings)), 0);