UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

40 lines (39 loc) 1.76 kB
/** * DevExtreme (esm/__internal/scheduler/view_model/preparation/utils/get_minimal_appointments.js) * Version: 25.2.8 * Build date: Mon Jun 08 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { isDefined } from "../../../../../core/utils/type"; export const getMinimalAppointments = (safeItems, _ref) => { let { dataAccessors: dataAccessors } = _ref; return safeItems.map(rawAppointment => { const startDateMs = dataAccessors.get("startDate", rawAppointment).getTime(); const startDateTimeZone = dataAccessors.get("startDateTimeZone", rawAppointment); const endDateMs = dataAccessors.get("endDate", rawAppointment).getTime(); const endDateTimeZone = dataAccessors.get("endDateTimeZone", rawAppointment); const rawVisible = dataAccessors.get("visible", rawAppointment); const visible = isDefined(rawVisible) ? Boolean(rawVisible) : true; return { allDay: dataAccessors.get("allDay", rawAppointment), startDateTimeZone: startDateTimeZone, endDateTimeZone: endDateTimeZone, source: { startDate: startDateMs, endDate: endDateMs }, recurrenceRule: dataAccessors.get("recurrenceRule", rawAppointment), recurrenceException: dataAccessors.get("recurrenceException", rawAppointment), hasRecurrenceRule: dataAccessors.isRecurrent(rawAppointment), visible: visible, disabled: dataAccessors.get("disabled", rawAppointment), itemData: rawAppointment } }) };