Skip to content
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

FIO-8477: Fix the timezones issue in formatDate function #114

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

roma-formio
Copy link
Contributor

@roma-formio roma-formio commented Jul 3, 2024

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-8477

Description

This PR addresses issues encountered with the formatDate function, originally implemented in the formio.js library, which utilizes the moment-timezone library for timezone formatting. Specifically, the z format option in moment-timezone, used for abbreviated timezone names, does not directly translate to the dayjs library we currently employ. To bridge this functionality gap, the advancedFormat plugin from dayjs is necessary. However, a known issue with dayjs (#1154) results in the generation of GMT+.. formats instead of abbreviated timezone names. Notably, the zzz format option in dayjs correctly provides the full timezone name.
image

During the process of integrating the advancedFormat plugin and updating the formatDate function, I also discovered and addressed a separate issue related to UTC formatting. Previously, the formatDate function incorrectly used the current date for UTC conversions instead of the provided date value.

How has this PR been tested?

Unit testing

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@roma-formio roma-formio requested a review from brendanbond July 3, 2024 12:13
@brendanbond brendanbond merged commit 48e4e28 into master Jul 5, 2024
5 checks passed
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.

2 participants