An ultimate timezone picker for React. Built on top of react-select, moment-timezone and using real timezone data from timezone-db
mikevercoelen.github.io/react-tz
You need to make sure you have these deps installed first:
- react
^16.8.6
- react-select
2.4.3^
- moment-timezone
2.24.0^
npm install react-tz --save
With peer deps:
npm install react react-select moment-timezone react-tz --save
import React, { useState } from 'react'
import { TimezoneSelect } from 'react-tz'
const Demo = () => {
const [timezone, setTimezone] = useState(null)
return (
<TimezoneSelect
value={timezone}
onChange={setTimezone} />
)
}
export default Demo