🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

react-timezone

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-timezone

React timezone picker

2.4.0
latest
58

Supply Chain Security

100

Vulnerability

63

Quality

76

Maintenance

100

License

Version published
Weekly downloads
2.1K
-36.12%
Maintainers
1
Weekly downloads
 
Created

react-timezone

Timezone Picker for React

Demo

Available here.

Installation

$ npm install react-timezone

Usage

This a controlled element. value and onChange needs to be set. Values are timezone codenames.

You can style the container element with className and style props.

Passing an object as inputProps prop will pass it to the underlying input. It can be used for setting name, placeholder on input or listening to input events.

Minimal styles are included with the build.

Timezones are included in the bundle and can be accessed by importing timezones from the package.

A zone object's structure is like this:

{
  name: string,
  label: string,
  offset: number,
}

Timezones

Timezones are stolenborrowed from Google Calendar.

Example

import TimezonePicker from 'react-timezone';

export default () => (
  <TimezonePicker
    value="Asia/Yerevan"
    onChange={timezone => console.log('New Timezone Selected:', timezone)}
    inputProps={{
      placeholder: 'Select Timezone...',
      name: 'timezone',
    }}
  />
);

FAQs

Package last updated on 16 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts