Skip to content

Scheduler: refactor core files (TS) - Part 2#33846

Open
bit-byte0 wants to merge 7 commits into
DevExpress:26_1from
bit-byte0:refactor/scheduler-core-ts-part-2
Open

Scheduler: refactor core files (TS) - Part 2#33846
bit-byte0 wants to merge 7 commits into
DevExpress:26_1from
bit-byte0:refactor/scheduler-core-ts-part-2

Conversation

@bit-byte0
Copy link
Copy Markdown
Contributor

What

rename m_utils.ts and m_utils_time_zone.ts to enable strict TS/ESLint rules, type all function params

How

type ~15 untyped params/returns, reorder declarations for no-use-before-define, fix no-param-reassign, add null-safety casts in consumer files, update ~30 import paths

@bit-byte0 bit-byte0 self-assigned this Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 12:47
@bit-byte0 bit-byte0 requested a review from a team as a code owner June 4, 2026 12:47
@bit-byte0 bit-byte0 added the 26_1 label Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the Scheduler TS refactor by renaming internal utility modules (m_utils*utils*), updating import paths across Scheduler core/view model/workspace code and tests, and tightening TypeScript typings to support stricter TS/ESLint settings.

Changes:

  • Renamed/replaced core Scheduler utilities (m_utils.tsutils.ts) and updated imports in Scheduler/workspaces/subscribes/scheduler.
  • Renamed/replaced timezone utilities (m_utils_time_zoneutils_time_zone) and updated imports in Scheduler code and test suites.
  • Refactored utils_time_zone.ts for stricter typing and rule compliance (typed params/returns, reordered helpers, added null-safety handling in some consumers/tests).

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timezones.tests.js Update timezone utils import path to renamed module.
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentsVertical.tests.js Update timezone utils import path to renamed module.
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/dataSource.tests.js Update timezone utils import path to renamed module.
packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js Update timezone utils import path to renamed module.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_provider.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_generator.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_generator_timeline_month.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_generator_month.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_grouped_data_map_provider.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_date_header_data_generator.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts Switch scheduler core utils import from m_utils to new utils.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts Switch scheduler core utils import from m_utils to new utils.
packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/view_model/get_appointment_info.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/steps/virtual_screen_filter.ts Switch timezone utils import and add casts for nullable return typing.
packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/options/get_minutes_cell_intervals.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/split_by_recurrence/get_date_information.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/view_model/common/get_compare_options.ts Switch timezone utils import and add casts for nullable return typing.
packages/devextreme/js/__internal/scheduler/utils.ts New typed replacement for m_utils.ts (DOM/data accessors + renovation rendering helper).
packages/devextreme/js/__internal/scheduler/utils_time_zone.ts Renamed/refactored timezone utilities with typed params/returns and reordered helpers.
packages/devextreme/js/__internal/scheduler/utils_time_zone.test.ts Update timezone utils import path to renamed module.
packages/devextreme/js/__internal/scheduler/utils_time_zone.santiago.test.ts Update timezone utils import path to renamed module.
packages/devextreme/js/__internal/scheduler/scheduler_options_base_widget.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/recurrence/generate_dates.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/r1/utils/base.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/r1/utils/agenda.ts Switch timezone utils import and add cast for nullable return typing.
packages/devextreme/js/__internal/scheduler/r1/utils/agenda.santiago.test.ts Switch timezone utils import and add null-safety fallback in helper.
packages/devextreme/js/__internal/scheduler/r1/utils/agenda.pacific.test.ts Switch timezone utils import and add null-safety fallback in helper.
packages/devextreme/js/__internal/scheduler/r1/timezone_calculator/utils.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/m_utils.ts Removed old Scheduler utils module (replaced by utils.ts).
packages/devextreme/js/__internal/scheduler/m_subscribes.ts Switch scheduler core utils import from m_utils to new utils.
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Switch imports from m_utils/m_utils_time_zone to utils/utils_time_zone.
packages/devextreme/js/__internal/scheduler/appointments/m_appointment_collection.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/appointment_popup/form.ts Switch timezone utils import to utils_time_zone.
packages/devextreme/js/__internal/scheduler/tests/performance.test.ts Update timezone utils import path to renamed module.
Comments suppressed due to low confidence (3)

packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:42

  • createUTCDateWithLocalOffset now returns Date | null | undefined, which forces many downstream casts even when callers pass a definite Date. Consider using overloads so Date input produces Date output while preserving null/undefined passthrough for nullable inputs.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:236
  • Line break/indentation in this calculation is inconsistent with surrounding style and easy to misread. Keeping the whole expression on one line avoids lint/formatting churn.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:265
  • The line break between the method call and * MS_IN_MINUTE is hard to read and may not match formatter expectations. Prefer a single-line expression here.

Comment thread packages/devextreme/js/__internal/scheduler/utils.ts
Comment thread packages/devextreme/js/__internal/scheduler/r1/utils/agenda.santiago.test.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/r1/utils/agenda.pacific.test.ts Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (4)

packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:29

  • After renaming m_utils_time_zone to utils_time_zone, there is still a consumer importing the removed module (packages/devextreme/js/common/core/environment/time_zone_utils.js imports ../../../__internal/scheduler/m_utils_time_zone). This will cause a runtime/module-resolution failure unless that import is updated or a compatibility re-export is kept.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:33
  • createUTCDateWithLocalOffset always returns a Date when the input is a Date, but the current Date | null | undefined return type forces widespread as Date casts in callers. Consider using overloads so the return type is inferred from the input (Date-in → Date-out, null/undefined-in → null/undefined-out).
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:236
  • Line break in the timezoneOffset calculation makes the / MINUTES_IN_HOUR part easy to miss and is inconsistent with the surrounding style; keeping this expression on one line also avoids potential indentation/spacing lint issues.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:265
  • getClientTimezoneOffset currently splits the multiplication onto a new unindented line, which is hard to read and may violate whitespace/indent lint rules. Keep the multiplication on the same line.

Copilot AI review requested due to automatic review settings June 4, 2026 15:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (3)

packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:33

  • createUTCDateWithLocalOffset now returns Date | null | undefined for all inputs, which forces downstream call sites (that pass a definite Date) to add as Date casts. Consider using overloads so calls with a Date return a Date, while still safely passing through null/undefined.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:236
  • The line break/indentation in the timezoneOffset calculation is likely to violate operator-linebreak/formatting rules and hurts readability. Wrap the expression in parentheses and keep the operator on the same line as the division.
    packages/devextreme/js/__internal/scheduler/utils_time_zone.ts:265
  • getClientTimezoneOffset is split across two lines with the * operator starting the next line, which is easy to miss and can trigger lint rules. Prefer a single-line expression (or parentheses) here.

Comment thread packages/devextreme/js/__internal/scheduler/utils.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants