Skip to content

fix(QueryBuilder): fix incorrect date#5129

Merged
zettca merged 1 commit intomasterfrom
fix/query_builder_date
Apr 6, 2026
Merged

fix(QueryBuilder): fix incorrect date#5129
zettca merged 1 commit intomasterfrom
fix/query_builder_date

Conversation

@plagoa
Copy link
Copy Markdown
Contributor

@plagoa plagoa commented Apr 1, 2026

No description provided.

@plagoa plagoa requested a review from a team as a code owner April 1, 2026 14:49
Copilot AI review requested due to automatic review settings April 1, 2026 14:49
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 addresses an incorrect date being produced/handled by the QueryBuilder DateTime value logic (likely caused by timezone-dependent UTC serialization).

Changes:

  • Updated formatDate to build a YYYY-MM-DD string from local date fields instead of toISOString().

Comment thread packages/core/src/QueryBuilder/Value/DateTimeValue.tsx Outdated
Comment thread packages/core/src/QueryBuilder/Value/DateTimeValue.tsx Outdated
@github-actions github-actions Bot temporarily deployed to uikit-docs/pr-5129 April 1, 2026 14:54 Destroyed
@plagoa plagoa force-pushed the fix/query_builder_date branch from 9c0a15e to 2b6d0cb Compare April 3, 2026 16:40
@github-actions github-actions Bot temporarily deployed to uikit-docs/pr-5129 April 3, 2026 16:45 Destroyed
@plagoa plagoa force-pushed the fix/query_builder_date branch from 2b6d0cb to 0529c29 Compare April 6, 2026 15:23
@github-actions github-actions Bot temporarily deployed to uikit-docs/pr-5129 April 6, 2026 15:27 Destroyed
Copy link
Copy Markdown
Member

@zettca zettca left a comment

Choose a reason for hiding this comment

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

we should be testing this

here's a test 😄

  it("selects a date accordingly", async () => {
    const user = userEvent.setup();
    render(<HvQueryBuilder attributes={attributes} />);

    await user.click(screen.getByRole("button", { name: /Add condition/i }));
    await user.click(screen.getByRole("combobox", { name: /Attribute/i }));
    await user.click(screen.getByRole("option", { name: /Release/i }));

    await user.click(screen.getByRole("combobox", { name: /Operator/i }));
    await user.click(
      screen.getAllByRole("option", { name: /Greater than/i })[0],
    );

    const dateInput = screen.getByRole("combobox", { name: /Date/i });
    expect(dateInput).toBeInTheDocument();
    await user.click(dateInput);

    const dayButton = screen.getByRole("button", { name: "15" });
    await user.click(dayButton);
    expect(dateInput).toHaveTextContent(/15/);
  });

Comment thread packages/core/src/QueryBuilder/Value/DateTimeValue.tsx Outdated
@zettca zettca merged commit 75dab8d into master Apr 6, 2026
16 checks passed
@zettca zettca deleted the fix/query_builder_date branch April 6, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants