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

Add "extraLabels" from custom cities for each timezone #78

Closed
1 task done
Toledodev opened this issue Oct 26, 2022 · 3 comments
Closed
1 task done

Add "extraLabels" from custom cities for each timezone #78

Toledodev opened this issue Oct 26, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Toledodev
Copy link

Clear and concise description of the problem

At the moment we are not able to create custom timezones, so the ideal would be to give the user the option to be able to create custom timezones. We could use all the information from an existing timezone and just change the value to show in the dropdown

Suggested solution

Add an "extraLabels" prop, which proposes to the user to add a customized label to some timezone. The extraLabels prop is empty by default, when a user wants to add some custom content to the dropdown (like a city) just add an object to the extraLabels prop containing the key label (which will be the name of the timezone in the dropdown) and the key tz (which will be the timezone in which the entry will be entered).
For example, if I add this object to extraLabels:

Screenshot_4

The result in the dropdown will be this: https://www.loom.com/share/6b1e7685dec0409d8b436f38c1a70803

Alternative

No response

Additional context

No response

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@Toledodev Toledodev added the enhancement New feature or request label Oct 26, 2022
@ndom91
Copy link
Owner

ndom91 commented Oct 26, 2022

Hi @Toledodev thanks for the feedback!

Did you see the "Custom Timezone" section in the README? This should (hopefully) work for you.

See: https://github.com/ndom91/react-timezone-select#-custom-timezones

Also this codesandbox example from the README includes two custom timezones (Pittsburgh and Frankfurt) as well if you want to take a look 👍

@PeerRich
Copy link

I dont think that does it. we wanna add a ton of cities in the autocomplete but not show them in the dropdown

@ndom91
Copy link
Owner

ndom91 commented Dec 10, 2023

Closing this in favor of your work on the "filter timezones by cities" work here.

If you still want an additional feature to override the labels for existing timezones, feel free to open another issue 👍

@ndom91 ndom91 closed this as completed Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants