fix(flex-fields): make DateTimeViewComponent respect DateTime.InputMode - #235
Merged
Conversation
DateTimeViewComponent always rendered value | shortDateTime, ignoring the field's DateTime.InputMode configuration. Date/Month-mode fields therefore showed a spurious time part in every read-only context, including Table columns dispatched through ff-table-view. Mirror DateTimeControlComponent's approach: look up the configured mode's format in DATE_INPUT_MODE_FORMATS and format with DatePipe, falling back to the shortDateTime pipe when no configuration/mode is available. Fixes #234
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.
Summary
DateTimeViewComponentalways renderedvalue | shortDateTime, ignoring the field'sDateTime.InputModeconfiguration, soDate/Month-mode fields showed a spurious time part in every read-only context (includingTablecolumns dispatched throughff-table-view).DateTimeControlComponent's approach: look up the configured mode's format inDATE_INPUT_MODE_FORMATS, format withDatePipe, and fall back to theshortDateTimepipe when no configuration/mode is available (so existing usages that never passfield.configurationrender unchanged).CHANGELOG.mdentry under[Unreleased].Closes #234
Test plan
ng test flex-fields— full suite, 43 files / 306 tests, all passing (including 3 newInputModecases + 1 no-configuration fallback case indate-time-view.component.spec.ts)ng build flex-fields— builds cleanly