Socket
Socket
Sign inDemoInstall

cronofy-elements

Package Overview
Dependencies
Maintainers
3
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cronofy-elements - npm Package Compare versions

Comparing version 1.48.1 to 1.48.2

build/CronofyElements.v1.48.2.js

2

package.json
{
"name": "cronofy-elements",
"version": "1.48.1",
"version": "1.48.2",
"description": "Fast track scheduling with Cronofy's embeddable UI Elements",

@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js",

@@ -45,1 +45,18 @@ import moment from "moment-timezone";

};
export const addTzidToTzList = (tzList, tzid) => {
const isValidTimeZone = !!moment.tz.zone(tzid);
if (isValidTimeZone) {
const newTzList = [...tzList];
const item = createTzObject(tzid);
newTzList.push(item);
newTzList.sort((tzA, tzB) => tzA.offsetMins - tzB.offsetMins);
return {
tzList: newTzList,
selectedTzid: item,
};
} else {
throw `There was an error setting the selected tzid as ${tzid}.`;
}
};

@@ -17,3 +17,3 @@ import React, { useState, useEffect } from "react";

} from "../../helpers/utils.AvailabilityRules";
import { getInitialSelectedTzid } from "./utils/tz-utils";
import { getInitialSelectedTzid, addTzidToTzList } from "./utils/tz-utils";
import { parseStyleOptions, classBuilder } from "../../helpers/theming";

@@ -202,6 +202,15 @@ import { globals } from "../../styles/utils";

);
setTz({
list: tz.list,
selectedTzid: selectedTzid,
});
if (selectedTzid) {
setTz({
list: tz.list,
selectedTzid: selectedTzid,
});
} else {
//If we get here the tzid from the availbility rule is not in the tz.list so we need to add it.
const result = addTzidToTzList(tz.list, rulesResponse.availability_rule.tzid);
setTz({
list: result.tzList,
selectedTzid: result.selectedTzid,
});
}

@@ -208,0 +217,0 @@ setSlots(slots => {

Sorry, the diff of this file is too big to display

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