Skip to content

feat(edit-content): add system timezone support to calendar field component #32142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oidacra
Copy link
Member

@oidacra oidacra commented May 9, 2025

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:

  • Added a SystemTimezone interface and integrated it into ConfigParams in dotcms-config.service.ts to provide system timezone configuration. Updated the DotcmsConfigService to include the new systemTimezone property. [1] [2] [3]
  • Updated 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:

  • Modified DotEditContentFieldComponent and DotEditContentFormComponent to inject DotcmsConfigService 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]
  • Updated dot-edit-content-calendar-field.component.html to include hints and timezone labels dynamically based on the system timezone.

Utility and Interface Updates:

  • Added CALENDAR_FIELD_TYPES_WITH_TIME constant to distinguish calendar field types that include time. Updated related utilities and constants accordingly. [1] [2] [3] [4]
  • Extended FormFieldValue type to support number 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

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

Additional Info

** any additional useful context or info **

Screenshots

Original Updated
** original screenshot ** ** updated screenshot **

Copy link

Please use a Conventional Commit title format for this PR. For more information, see https://www.conventionalcommits.org/en/v1.0.0/

…ponent

This commit introduces a new  interface and integrates timezone handling into the . Key changes include:

- Added  property to the  interface.
- Updated the calendar field component to display the system timezone label when applicable.
- Enhanced the calendar field's HTML and TypeScript to support timezone adjustments for date inputs.
- Refactored related utility functions to accommodate timezone logic.

These updates improve the user experience by ensuring accurate date and time representation based on the configured system timezone.
@oidacra oidacra force-pushed the 31248-UTM-label branch from fc221bd to abd4d00 Compare May 20, 2025 17:59
@oidacra oidacra changed the title delete me feat(edit-content): add system timezone support to calendar field component May 20, 2025
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.

1 participant