UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

26 lines (25 loc) 859 B
/** * DevExtreme (esm/__internal/scheduler/view_model/common/is_appointment_matched_intervals.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ export const isAppointmentMatchedIntervals = (_ref, intervals) => { let { startDate: startDate, endDate: endDate } = _ref; const intersectionIntervalIndex = intervals.findIndex(_ref2 => { let { max: max } = _ref2; return startDate < max }); if (-1 === intersectionIntervalIndex) { return false } const intervalStartDate = intervals[intersectionIntervalIndex].min; return startDate >= intervalStartDate || endDate > intervalStartDate };