-
Notifications
You must be signed in to change notification settings - Fork 278
AAE-39261 Fix Portuguese date format to display dd/mm/yyyy #11303
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
Conversation
- Added support for 'pt' locale code in DateFnsUtils.getLocaleFromString() - Both 'pt' and 'pt-BR' now correctly map to ptBR locale (dd/mm/yyyy format) - Added comprehensive test coverage for all locale mappings using data-driven tests - Fixed naming conflict by aliasing Italian locale import
Quality Gate Passed Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a date format display issue where the Portuguese language setting was showing dates in mm/dd/yyyy format instead of the expected dd/mm/yyyy format. The fix adds support for the 'pt' locale code to correctly map to the ptBR locale.
Key changes:
- Added 'pt' locale code mapping to ptBR in the DateFnsUtils class
- Added comprehensive test coverage for all locale mappings including the new 'pt' case
- Aliased Italian locale import to avoid naming conflict with Jasmine's
itfunction
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/core/src/lib/common/utils/date-fns-utils.ts | Added 'pt' case to switch statement to map to ptBR locale |
| lib/core/src/lib/common/utils/date-fns-utils.spec.ts | Added comprehensive test suite for getLocaleFromString method covering all locale mappings including 'pt' and 'pt-BR' |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Description
Fixes AAE-39261
When selecting Portuguese language in application settings, dates in Dashboard's 'From Date' and 'To Date' fields were incorrectly displaying in mm/dd/yyyy format instead of the expected dd/mm/yyyy format.
Changes Made
DateFnsUtils.getLocaleFromString()itfunctionTesting
Steps to Reproduce Original Issue
Expected: Date displays as dd/mm/yyyy
Actual (before fix): Date displayed as mm/dd/yyyy
Actual (after fix): Date displays as dd/mm/yyyy ✅