Skip to content

FirstDayOfWeek -> DayOfWeek#33523

Merged
mpreyskurantov merged 6 commits intoDevExpress:26_1from
mpreyskurantov:26_1-patch-33188-ts-net
May 8, 2026
Merged

FirstDayOfWeek -> DayOfWeek#33523
mpreyskurantov merged 6 commits intoDevExpress:26_1from
mpreyskurantov:26_1-patch-33188-ts-net

Conversation

@mpreyskurantov
Copy link
Copy Markdown
Contributor

@mpreyskurantov mpreyskurantov commented May 7, 2026

Patch for:

Known issues / observations:

  • Kept export from common with @public (plus, reserved in aliases) & depreacted types' re-exports from ui - for backward compatibility in wrappers' common / index re-exports & component / ui modules bags / re-export (even our demos use them)
    ...

@mpreyskurantov mpreyskurantov self-assigned this May 7, 2026
Copilot AI review requested due to automatic review settings May 7, 2026 16:58
@mpreyskurantov mpreyskurantov requested review from a team as code owners May 7, 2026 16:58
@github-actions github-actions Bot added the .d.ts label May 7, 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 standardizes weekday typing across DevExtreme by introducing DevExpress.common.DayOfWeek (0–6) and migrating Scheduler/Calendar/Gantt firstDayOfWeek and Scheduler hiddenWeekDays typings to use it, while keeping FirstDayOfWeek as a deprecated alias. This aligns the public typings with the Scheduler “hide arbitrary days of the week” work in #33188.

Changes:

  • Added DevExpress.common.DayOfWeek and deprecated DevExpress.common.FirstDayOfWeek in favor of it.
  • Updated core TS declarations (dx.all.d.ts, common.d.ts, UI component .d.ts) and internal TS types to use DayOfWeek.
  • Updated Angular/React/Vue wrapper typings to reference DayOfWeek (and adjusted hiddenWeekDays optionality).

Reviewed changes

Copilot reviewed 24 out of 32 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/devextreme/ts/dx.all.d.ts Introduces DevExpress.common.DayOfWeek, deprecates FirstDayOfWeek, updates component option typings and Scheduler hiddenWeekDays.
packages/devextreme/ts/aliases.d.ts Adds deprecated alias DevExpress.common.FirstDayOfWeek = DayOfWeek for compatibility in aliased typings.
packages/devextreme/js/ui/scheduler.d.ts Switches Scheduler typings to import/export DayOfWeek from common and updates firstDayOfWeek/hiddenWeekDays option types.
packages/devextreme/js/ui/scheduler_types.d.ts Updates re-export surface for Scheduler types to include DayOfWeek.
packages/devextreme/js/ui/gantt.d.ts Migrates Gantt firstDayOfWeek option typing to DayOfWeek.
packages/devextreme/js/ui/calendar.d.ts Switches Calendar typings to import/export DayOfWeek from common and updates firstDayOfWeek option type.
packages/devextreme/js/ui/calendar_types.d.ts Updates re-export surface for Calendar types to include DayOfWeek.
packages/devextreme/js/common.d.ts Adds DayOfWeek and marks FirstDayOfWeek as deprecated alias.
packages/devextreme/js/__internal/ui/calendar/calendar.views.ts Updates internal Calendar view props to use DayOfWeek.
packages/devextreme/js/__internal/scheduler/m_scheduler.ts Updates internal Scheduler getFirstDayOfWeek() typing to return DayOfWeek.
packages/devextreme/js/__internal/scheduler/header/types.ts Updates Scheduler header option types to use DayOfWeek.
packages/devextreme-vue/src/scheduler.ts Updates Vue Scheduler wrapper prop typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-vue/src/gantt.ts Updates Vue Gantt wrapper prop typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-vue/src/date-range-box.ts Updates Vue DateRangeBox calendarOptions firstDayOfWeek prop typing to use DayOfWeek.
packages/devextreme-vue/src/date-box.ts Updates Vue DateBox calendarOptions firstDayOfWeek prop typing to use DayOfWeek.
packages/devextreme-vue/src/common/index.ts Exposes DayOfWeek from the Vue common re-export surface.
packages/devextreme-vue/src/calendar.ts Updates Vue Calendar wrapper prop typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-react/src/scheduler.ts Updates React Scheduler wrapper types to use DayOfWeek from common and adjusts hiddenWeekDays optionality.
packages/devextreme-react/src/date-range-box.ts Updates React DateRangeBox calendarOptions firstDayOfWeek typing to use DayOfWeek.
packages/devextreme-react/src/date-box.ts Updates React DateBox calendarOptions firstDayOfWeek typing to use DayOfWeek.
packages/devextreme-react/src/common/index.ts Exposes DayOfWeek from the React common re-export surface.
packages/devextreme-metadata/aspnet/enums.ts Removes weekday numeric enum-item renaming mapping from ASP.NET metadata generation inputs.
packages/devextreme-angular/src/ui/scheduler/nested/view-dxi.ts Updates Angular Scheduler nested view option types (firstDayOfWeek, hiddenWeekDays) to use DayOfWeek.
packages/devextreme-angular/src/ui/scheduler/index.ts Updates Angular Scheduler component option/event typings to use DayOfWeek and adjusts hiddenWeekDays optionality.
packages/devextreme-angular/src/ui/nested/view-dxi.ts Updates shared Angular nested view typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/ui/nested/base/calendar-options.ts Updates Angular calendar-options base nested option typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/ui/gantt/index.ts Updates Angular Gantt component option/event typings for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/ui/date-range-box/nested/calendar-options.ts Updates Angular DateRangeBox nested calendar-options typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/ui/date-box/nested/calendar-options.ts Updates Angular DateBox nested calendar-options typing for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/ui/calendar/index.ts Updates Angular Calendar component option/event typings for firstDayOfWeek to use DayOfWeek.
packages/devextreme-angular/src/index.ts Exposes DayOfWeek on the Angular package Common namespace surface.
packages/devextreme-angular/src/common/index.ts Exposes DayOfWeek from the Angular common re-export surface.
Comments suppressed due to low confidence (1)

packages/devextreme-metadata/aspnet/enums.ts:428

  • enumItemRenamings no longer contains the numeric-to-name mapping for weekday values. After renaming FirstDayOfWeek to DayOfWeek, the ASP.NET metadata generator will likely need the same mapping under the new enum/type name (e.g., 0 -> Sunday, ..., 6 -> Saturday) to keep generated enum member names stable and readable.
export const enumItemRenamings = {
  '.*': {
    'dx(.*)': '$1',
  },

  '(.*FilterOperations|.*SearchMode|ComparisonOperator)': {
    '>=': 'greaterThanOrEqual',
    '<=': 'lessThanOrEqual',
    '<>': 'notEqual',
    '===': 'strictEqual',
    '!==': 'notStrictEqual',
    '==': 'equal',
    '!=': 'notEqual',
    '=': 'equal',
    '>': 'greaterThan',
    '<': 'lessThan',
    'startswith': 'startsWith',
    'endswith': 'endsWith',
    'isblank': 'isBlank',
    'isnotblank': 'isNotBlank',
    'anyof': 'anyOf',
    'noneof': 'noneOf',
    'notcontains': 'notContains',
  },

  '(.*Data|DateBox)Type': {
    'datetime': 'DateTime',
  },

  'GaugeOverlappingBehavior': {
    'first': 'HideFirstLabel',
    'last': 'HideLastLabel',
  },

…and components' bags re-exports (our own demos failed), try to avoid prev error with aliases.d.ts (no more) + dx.all.d.ts
Copilot AI review requested due to automatic review settings May 7, 2026 18:52
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 24 out of 32 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/devextreme-metadata/aspnet/enums.ts:427

  • enumItemRenamings no longer contains a mapping for the day-of-week numeric union values. Since the corresponding public type was renamed to DayOfWeek, the ASP.NET metadata generator likely needs an equivalent DayOfWeek mapping (0..6 → Sunday..Saturday) to avoid generating invalid or less-friendly enum member names.
  '(.*Data|DateBox)Type': {
    'datetime': 'DateTime',
  },

  'GaugeOverlappingBehavior': {
    'first': 'HideFirstLabel',
    'last': 'HideLastLabel',
  },

sjbur
sjbur previously approved these changes May 7, 2026
…OfWeek type instead deprecation/deprecation)
@mpreyskurantov mpreyskurantov merged commit 1fd65f2 into DevExpress:26_1 May 8, 2026
173 of 174 checks passed
@mpreyskurantov mpreyskurantov deleted the 26_1-patch-33188-ts-net branch May 8, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants