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 Mar 10, 2026
Merged
Conversation
added 2 commits
March 10, 2026 14:52
Contributor
There was a problem hiding this comment.
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
dxDateBoxwithdateSerializationFormat: "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. |
packages/devextreme/js/__internal/core/utils/m_date_serialization.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/core/utils/m_date_serialization.ts
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
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
createLocalDateFromUTCTimestampto the exporteddateSerializationobject effectively extends the (deprecated but public)core/utils/date_serializationAPI surface. If this helper is only needed to implementdeserializeDateand/or for unit tests, consider keeping it private (not exported) and test the behavior throughdeserializeDateinputs instead, to avoid committing to this as a supported API.
const dateSerialization = {
createLocalDateFromUTCTimestamp,
dateParser,
deserializeDate,
serializeDate,
getDateSerializationFormat,
};
packages/devextreme/testing/tests/DevExpress.core/utils.date_serialization.tests.js
Show resolved
Hide resolved
r-farkhutdinov
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.