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

made changes in findAvailabletimezone & formatTimelabel for better handling which solve problem of undefined value issue #7712 #7766

Closed
wants to merge 2 commits into from

Conversation

Dharmil03
Copy link

@Dharmil03 Dharmil03 commented Oct 16, 2024

Fixes #7712

Copy link

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against 82e3d20

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

@@ -25,5 +30,6 @@ export const formatTimeZoneLabel = (ianaTimeZone: string) => {
? timeZoneWithGmtOffset
: [timeZoneWithGmtOffset, location].join(' - ');

return timeZoneLabel;
return timeZoneLabel.toLowerCase(); // Normalize case if necessary
Copy link
Contributor

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.

@charlesBochet
Copy link
Member

Looks duplicated

@charlesBochet
Copy link
Member

/award 150

Copy link

oss-gg bot commented Oct 31, 2024

Awarding Dharmil03: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/Dharmil03

@lucasbordeau
Copy link
Contributor

Thanks for your contribution, I'm closing this PR because we have to investigate first what's causing the problem.

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.

Investigate findAvailableTimeZoneOption undefined values
3 participants