UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

76 lines (74 loc) 2.76 kB
/** * DevExtreme (cjs/__internal/scheduler/workspaces/m_timeline_month.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/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _component_registrator = _interopRequireDefault(require("../../../core/component_registrator")); var _date = _interopRequireDefault(require("../../../core/utils/date")); var _index = require("../../scheduler/r1/components/index"); var _index2 = require("../../scheduler/r1/utils/index"); var _constants_view = require("../utils/options/constants_view"); var _m_timeline = _interopRequireDefault(require("./m_timeline")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e } } const TIMELINE_CLASS = "dx-scheduler-timeline-month"; class SchedulerTimelineMonth extends _m_timeline.default { constructor() { super(...arguments); this.viewDirection = "horizontal" } get type() { return _constants_view.VIEWS.TIMELINE_MONTH } get renovatedHeaderPanelComponent() { return _index.HeaderPanelComponent } renderView() { super.renderView(); this.updateScrollable() } getElementClass() { return TIMELINE_CLASS } getDateHeaderTemplate() { return this.option("dateCellTemplate") } calculateDurationInCells(timeDiff) { return timeDiff / this.getCellDuration() } isIndicatorVisible() { return true } getFormat() { return _index2.formatWeekdayAndDay } getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * this.option("startDayHour")) - timeZoneOffset } getViewStartByOptions() { return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate"))) } generateRenderOptions() { const options = super.generateRenderOptions(true); return Object.assign({}, options, { getDateForHeaderText: (_, date) => date }) } keepOriginalHours() { return true } }(0, _component_registrator.default)("dxSchedulerTimelineMonth", SchedulerTimelineMonth); var _default = exports.default = SchedulerTimelineMonth;