This is a fork of ndom91/react-timezone-select with the following changes:
- Removed
react-select
dependency - Exported only
useTimezoneSelect
andallTimezones
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>
)
}
You can use the useTimezoneSelect
hook to build your own custom timezone select component.
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!