Skip to content

Conversation

@anna-shakhova
Copy link
Contributor

No description provided.

@anna-shakhova anna-shakhova self-assigned this Jan 23, 2026
@anna-shakhova anna-shakhova requested a review from a team as a code owner January 23, 2026 10:48
Copilot AI review requested due to automatic review settings January 23, 2026 10:48
Copy link
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

Fixes FilterBuilder’s handling of invalid date values by preventing attempts to format invalid Date instances and expanding/relocating related test coverage.

Changes:

  • Treat invalid Date objects as invalid input in formatHelper.format() (returning value.toString() instead of passing them to date localization formatting).
  • Adjust FilterBuilder value formatting to avoid coercing non-string/non-numeric values into Date objects.
  • Update/add tests: expand formatHelper.format() coverage and move FilterBuilder formatting tests from QUnit to Jest (plus add a regression case).

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/testing/tests/DevExpress.utils/utils.formatHelper.tests.js Switches to ESM import and adds QUnit coverage for formatHelper.format() edge cases (including invalid dates).
packages/devextreme/testing/tests/DevExpress.ui.widgets/filterBuilderParts/utilsTests.js Removes the old QUnit “Formatting” module tests (migrated to Jest).
packages/devextreme/js/format_helper.js Prevents formatting invalid Date values by validating getTime() before delegating to date localization.
packages/devextreme/js/__internal/filter_builder/m_utils.ts Updates FilterBuilder value-to-text formatting (incl. typed refactor) to avoid unintended Date coercions.
packages/devextreme/js/__internal/filter_builder/tests/utils.test.ts Adds Jest coverage for FilterBuilder value formatting, including an invalid date string regression.

@anna-shakhova anna-shakhova force-pushed the 26_1__T1319193-filter-builder-date-format branch from 4e80475 to c311758 Compare January 23, 2026 11:13
@anna-shakhova anna-shakhova changed the title FilterBuilder: fix invalid date formatting FilterBuilder: fix invalid date formatting (T1319193) Jan 23, 2026
Alyar666
Alyar666 previously approved these changes Jan 26, 2026
Copy link
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 9 out of 12 changed files in this pull request and generated 4 comments.

@anna-shakhova anna-shakhova force-pushed the 26_1__T1319193-filter-builder-date-format branch from cde9e83 to 003b1d0 Compare January 26, 2026 17:22
@anna-shakhova anna-shakhova force-pushed the 26_1__T1319193-filter-builder-date-format branch from 003b1d0 to 779e531 Compare January 26, 2026 17:24
Copilot AI review requested due to automatic review settings January 26, 2026 17:24
@anna-shakhova anna-shakhova changed the title FilterBuilder: fix invalid date formatting (T1319193) FilterBuilder: fix invalid date formatting (T1319193, T1311486) Jan 26, 2026
Copy link
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 9 out of 12 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/filter_builder/m_utils.ts:604

  • New // @ts-expect-error suppressions were added for the customizeText payload. Rather than relying on suppression comments, it would be more robust to define an explicit internal payload type (or cast the payload to any in one place) so the expected shape is clear and future type changes don't get silently masked.
    valueText = field.customizeText.call(field, {
      // @ts-expect-error
      value,
      valueText,
      target,
    });

const GRID_CONTAINER = '#container';

// T1319193, T1311486
test('Proper handle custom filter operations for dates with non-date values', async (t) => {
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

Test name grammar: "Proper handle ..." → "Properly handle ...".

Suggested change
test('Proper handle custom filter operations for dates with non-date values', async (t) => {
test('Properly handle custom filter operations for dates with non-date values', async (t) => {

Copilot uses AI. Check for mistakes.
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

return this.getHeadersContainer().child(`.${this.addWidgetPrefix(CLASS.filterRangeOverlay)}`);
}

getFilterRangeStartEditor(): DateBox {
Copy link
Contributor

Choose a reason for hiding this comment

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

The filter range start/end editor can also be NumberBox

@Raushen Raushen merged commit d7d5828 into DevExpress:26_1 Jan 27, 2026
94 checks passed
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.

3 participants