timezone-list-hook
This is a fork of ndom91/react-timezone-select with the following changes:
🪝 Hooks
import { useTimezoneSelect, allTimezones } from 'timezone-list-hook'
const labelStyle = 'original'
const timezones = {
...allTimezones,
'Europe/Berlin': 'Frankfurt',
}
const customSelect = () => {
const { options, parseTimezone } = useTimezoneSelect({
labelStyle,
timezones,
})
return (
<select onChange={(e) => onChange(parseTimezone(e.currentTarget.value))}>
{options.map((option) => (
<option value={option.value}>{option.label}</option>
))}
</select>
)
}
OR
You can use the useTimezoneSelect
hook to build your own custom timezone select component.
🚧 Contributing
Pull requests are always welcome! Please stick to repo settings (prettier, eslint, etc.), and if adding new features, please consider adding test(s) and documentation where appropriate!