-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
made changes in findAvailabletimezone & formatTimelabel for better handling which solve problem of undefined value issue #7712 #7766
Conversation
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
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.
PR Summary
This pull request enhances the handling of time zone options and labels in the localization module, addressing issues with undefined values and improving input validation.
- Added input validation in
findAvailableTimeZoneOption.ts
to return undefined for invalid inputs - Implemented case-insensitive matching for time zone labels in
findAvailableTimeZoneOption.ts
- Introduced error handling in
formatTimeZoneLabel.ts
for invalid IANA time zone inputs - Normalized time zone labels to lowercase in both functions for consistency
- Explicitly set return type to string in
formatTimeZoneLabel.ts
for improved type safety
2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-front/src/modules/localization/utils/findAvailableTimeZoneOption.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/localization/utils/findAvailableTimeZoneOption.ts
Show resolved
Hide resolved
@@ -25,5 +30,6 @@ export const formatTimeZoneLabel = (ianaTimeZone: string) => { | |||
? timeZoneWithGmtOffset | |||
: [timeZoneWithGmtOffset, location].join(' - '); | |||
|
|||
return timeZoneLabel; | |||
return timeZoneLabel.toLowerCase(); // Normalize case if necessary |
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.
style: Normalizing the entire label to lowercase may affect readability of time zone names and locations. Consider keeping proper capitalization.
Looks duplicated |
/award 150 |
Awarding Dharmil03: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/Dharmil03 |
Thanks for your contribution, I'm closing this PR because we have to investigate first what's causing the problem. |
Fixes #7712