@tagmango-inc/react-timezone
v0.0.1
Published
Usable, dynamic React Timezone
Downloads
2
Readme
🌐⌚ react-timezone
🏗️ Installing
npm install @tagmango-inc/react-timezone
🔭 Usage
import { useTimezoneSelect, allTimezones } from "@tagmango-inc/react-timezone"
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>
)
}
📝 License
MIT