UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

44 lines (43 loc) 1.53 kB
/** * DevExtreme (esm/__internal/scheduler/view_model/filtration/get_occurrences.js) * Version: 26.1.3 * Build date: Wed Jun 10 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { addAllDayPanelOccupation } from "./utils/add_all_day_panel_occupation"; import { filterByIntervals } from "./utils/filter_by_intervals/filter_by_intervals"; import { getFilterOptions } from "./utils/get_filter_options/get_filter_options"; import { splitByRecurrence } from "./utils/split_by_recurrence/split_by_recurrence"; export const getOccurrences = (schedulerStore, startDate, endDate, appointments) => { const compareOptions = { startDayHour: 0, endDayHour: 24, min: startDate.getTime(), max: endDate.getTime(), skippedDays: [] }; const filterOptions = Object.assign({}, getFilterOptions(schedulerStore, compareOptions), { allDayPanelMode: "allDay", supportAllDayPanel: true, isDateTimeView: true }); const step1 = addAllDayPanelOccupation(appointments, filterOptions); const step2 = splitByRecurrence(step1, filterOptions); const step3 = filterByIntervals(step2, filterOptions); const step4 = step3.map(appointment => ({ startDate: new Date(appointment.source.startDate), endDate: new Date(appointment.source.endDate), appointmentData: appointment.itemData })); return step4 };