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 3.1.0 to 3.2.0

5

dist/index.d.ts

@@ -21,2 +21,3 @@ import * as react_jsx_runtime_js from 'react/jsx-runtime.js';

timezones?: ICustomTimezone;
currentDatetime?: Date | string;
};

@@ -30,8 +31,8 @@ type Props = Omit<Props$1<ITimezone, false>, 'onChange'> & TimezoneSelectOptions & {

declare function useTimezoneSelect({ timezones, labelStyle, displayValue, }: TimezoneSelectOptions): {
declare function useTimezoneSelect({ timezones, labelStyle, displayValue, currentDatetime, }: TimezoneSelectOptions): {
parseTimezone: (zone: ITimezone) => ITimezoneOption;
options: ITimezoneOption[];
};
declare const TimezoneSelect: ({ value, onBlur, onChange, labelStyle, displayValue, timezones, ...props }: Props) => react_jsx_runtime_js.JSX.Element;
declare const TimezoneSelect: ({ value, onBlur, onChange, labelStyle, displayValue, timezones, currentDatetime, ...props }: Props) => react_jsx_runtime_js.JSX.Element;
export { ILabelStyle, ITimezone, ITimezoneOption, Props, TimezoneSelectOptions, allTimezones, TimezoneSelect as default, useTimezoneSelect };

18

dist/index.js

@@ -125,3 +125,4 @@ var __defProp = Object.defineProperty;

labelStyle = "original",
displayValue = "GMT"
displayValue = "GMT",
currentDatetime
}) {

@@ -132,3 +133,3 @@ const options = useMemo(() => {

try {
const now = spacetime.now(zone[0]);
const now = (currentDatetime ? spacetime(currentDatetime) : spacetime.now()).goto(zone[0]);
const isDstString = now.isDST() ? "daylight" : "standard";

@@ -174,5 +175,5 @@ const tz = now.timezone();

try {
currentTime = spacetime.now(zone);
currentTime = (currentDatetime ? spacetime(currentDatetime) : spacetime.now()).goto(zone);
} catch (err) {
currentTime = spacetime.now("GMT");
currentTime = (currentDatetime ? spacetime(currentDatetime) : spacetime.now()).goto("GMT");
}

@@ -222,3 +223,4 @@ return options.filter(

displayValue,
timezones
timezones,
currentDatetime
} = _b, props = __objRest(_b, [

@@ -230,3 +232,4 @@ "value",

"displayValue",
"timezones"
"timezones",
"currentDatetime"
]);

@@ -236,3 +239,4 @@ const { options, parseTimezone } = useTimezoneSelect({

labelStyle,
displayValue
displayValue,
currentDatetime
});

@@ -239,0 +243,0 @@ const handleChange = (tz) => {

{
"name": "react-timezone-select",
"version": "3.1.0",
"version": "3.2.0",
"description": "Usable, dynamic React Timezone Select",

@@ -5,0 +5,0 @@ "scripts": {

@@ -133,2 +133,3 @@ # 🌐⌚ react-timezone-select

- `timezones` - `Record<string,string>`
- `currentDatetime` - `Date | string` - Set datetime used to calculate timezone values (alternative to current datetime)
```

@@ -135,0 +136,0 @@ timezones={{

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