feat(edit-content): add system timezone support to calendar field component #32142
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.
This pull request introduces timezone support for calendar fields and refactors related components to improve functionality and maintainability. Key updates include adding a system timezone configuration, enhancing the
DotEditContentCalendarFieldComponent
with timezone handling, and updating related utilities and interfaces to support the changes.Timezone Support Enhancements:
SystemTimezone
interface and integrated it intoConfigParams
indotcms-config.service.ts
to provide system timezone configuration. Updated theDotcmsConfigService
to include the newsystemTimezone
property. [1] [2] [3]DotEditContentCalendarFieldComponent
to handle timezone adjustments, including computing default dates and displaying timezone labels when applicable. Added utility methods for timezone conversion and adjusted the component's structure for better readability. [1]R1, [2] [3] [4]Component Refactoring:
DotEditContentFieldComponent
andDotEditContentFormComponent
to injectDotcmsConfigService
and compute the system timezone as a reactive signal. Updated templates to pass the timezone to child components. [1] [2] [3] [4] [5] [6] [7]dot-edit-content-calendar-field.component.html
to include hints and timezone labels dynamically based on the system timezone.Utility and Interface Updates:
CALENDAR_FIELD_TYPES_WITH_TIME
constant to distinguish calendar field types that include time. Updated related utilities and constants accordingly. [1] [2] [3] [4]FormFieldValue
type to supportnumber
for better flexibility in form data handling.These changes collectively enhance the system's ability to handle timezones effectively while maintaining a clean and modular codebase.
Checklist
Additional Info
** any additional useful context or info **
Screenshots