Skip to content

DateBox: Use UTC units to get correct date, if date is just a year string (T1323373)#32850

Merged
marker-dao merged 4 commits intoDevExpress:26_1from
marker-dao:26_1_T1323373_datebox
Mar 10, 2026
Merged

DateBox: Use UTC units to get correct date, if date is just a year string (T1323373)#32850
marker-dao merged 4 commits intoDevExpress:26_1from
marker-dao:26_1_T1323373_datebox

Conversation

@marker-dao
Copy link
Contributor

No description provided.

@marker-dao marker-dao self-assigned this Mar 10, 2026
@marker-dao marker-dao marked this pull request as ready for review March 10, 2026 13:54
@marker-dao marker-dao requested a review from a team as a code owner March 10, 2026 13:54
Copilot AI review requested due to automatic review settings March 10, 2026 13:54
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

This PR adjusts DevExtreme DateBox/date serialization behavior to avoid incorrect day shifts when parsing year-only (and other date-only) string values, and updates the jQuery playground to reproduce the scenario.

Changes:

  • Update date deserialization to construct a local date using UTC calendar units for inputs detected as having no time component.
  • Minor refactors in DateBox and CalendarStrategy value syncing (no functional changes intended).
  • Update the jQuery playground sample to use a dxDateBox with dateSerializationFormat: "y".

Reviewed changes

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

File Description
packages/devextreme/playground/jquery.html Replaces the playground button with a DateBox configured to serialize/parse year-only values.
packages/devextreme/js/__internal/ui/date_box/m_date_box.strategy.calendar.ts Refactors _updateValue() to set widget options via object form.
packages/devextreme/js/__internal/ui/date_box/date_box.base.ts Refactors serialization/deserialization code into named locals for clarity.
packages/devextreme/js/__internal/core/utils/m_date_serialization.ts Adds UTC-based local date construction for “no time component” parsed strings.

Copilot AI review requested due to automatic review settings March 10, 2026 16:12
@marker-dao marker-dao closed this Mar 10, 2026
@marker-dao marker-dao reopened this Mar 10, 2026
@marker-dao marker-dao closed this Mar 10, 2026
@marker-dao marker-dao reopened this Mar 10, 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 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/core/utils/m_date_serialization.ts:203

  • Adding createLocalDateFromUTCTimestamp to the exported dateSerialization object effectively extends the (deprecated but public) core/utils/date_serialization API surface. If this helper is only needed to implement deserializeDate and/or for unit tests, consider keeping it private (not exported) and test the behavior through deserializeDate inputs instead, to avoid committing to this as a supported API.
const dateSerialization = {
  createLocalDateFromUTCTimestamp,
  dateParser,
  deserializeDate,
  serializeDate,
  getDateSerializationFormat,
};

@marker-dao marker-dao merged commit 0dd353e into DevExpress:26_1 Mar 10, 2026
171 of 250 checks passed
@marker-dao marker-dao deleted the 26_1_T1323373_datebox branch March 10, 2026 18:03
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.

3 participants