Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-timezone-select

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-timezone-select - npm Package Compare versions

Comparing version 1.5.6 to 2.0.0

41

dist/index.d.ts
import { Props as Props$1 } from 'react-select';
declare type ICustomTimezone = {
[key: string]: string
}
declare type ILabelStyle = 'original' | 'altName' | 'abbrev'
[key: string]: string;
};
declare type ILabelStyle = 'original' | 'altName' | 'abbrev';
interface ITimezoneOption {
value: string
label: string
offset: number
abbrev?: string
altName?: string
value: string;
label: string;
abbrev?: string;
altName?: string;
offset?: number;
}
declare type ITimezone = ITimezoneOption | string
interface Props
extends Omit<Props$1<ITimezone, false>, 'onChange'> {
value: ITimezone
labelStyle?: ILabelStyle
onChange?: (timezone: ITimezoneOption) => void
timezones?: ICustomTimezone
maxAbbrLength?: number
declare type ITimezone = ITimezoneOption | string;
interface Props extends Omit<Props$1<ITimezone, false>, 'onChange'> {
value: ITimezone;
labelStyle?: ILabelStyle;
onChange?: (timezone: ITimezoneOption) => void;
timezones?: ICustomTimezone;
maxAbbrLength?: number;
}

@@ -26,12 +25,4 @@

declare const TimezoneSelect: ({
value,
onBlur,
onChange,
labelStyle,
timezones,
maxAbbrLength,
...props
}: Props) => JSX.Element
declare const TimezoneSelect: ({ value, onBlur, onChange, labelStyle, timezones, maxAbbrLength, ...props }: Props) => JSX.Element;
export { ILabelStyle, ITimezone, ITimezoneOption, Props, allTimezones, TimezoneSelect as default };

@@ -97,10 +97,8 @@ // src/index.tsx

labelStyle = "original",
timezones,
timezones = timezone_list_default,
maxAbbrLength = 4,
...props
}) => {
if (!timezones)
timezones = timezone_list_default;
const getOptions = React.useMemo(() => {
return Object.entries(timezones).reduce((selectOptions, zone) => {
const getOptions = React.useMemo(
() => Object.entries(timezones).reduce((selectOptions, zone) => {
try {

@@ -140,4 +138,5 @@ const now = spacetime.now(zone[0]);

}
}, []).sort((a, b) => a.offset - b.offset);
}, [labelStyle, timezones]);
}, []).sort((a, b) => a.offset - b.offset),
[labelStyle, timezones]
);
const handleChange = (tz) => {

@@ -198,6 +197,5 @@ onChange && onChange(tz);

};
var src_default = TimezoneSelect;
export {
timezone_list_default as allTimezones,
src_default as default
TimezoneSelect as default
};
{
"name": "react-timezone-select",
"version": "1.5.6",
"version": "2.0.0",
"description": "Usable, dynamic React Timezone Select",

@@ -51,6 +51,6 @@ "scripts": {

"react": "^18 || ^17.0.1 || ^16",
"react-dom": "^18 || ^17.0.1 || ^16"
"react-dom": "^18 || ^17.0.1 || ^16",
"react-select": "^5.7.0"
},
"dependencies": {
"react-select": "^5.7.0",
"spacetime": "^7.4.1",

@@ -57,0 +57,0 @@ "timezone-soft": "^1.4.1"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc