cronofy-elements
Advanced tools
Comparing version 1.34.3 to 1.34.4
{ | ||
"name": "cronofy-elements", | ||
"version": "1.34.3", | ||
"version": "1.34.4", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
@@ -40,2 +40,3 @@ import React, { useContext, useEffect, useState } from "react"; | ||
i18n, | ||
locale: status.locale, | ||
}) | ||
@@ -100,2 +101,3 @@ ); | ||
i18n, | ||
locale: status.locale, | ||
}) | ||
@@ -102,0 +104,0 @@ ); |
@@ -17,2 +17,3 @@ import React, { useEffect, useRef, useState } from "react"; | ||
const tzRef = useRef(); | ||
const tzListRef = useRef(); | ||
@@ -67,3 +68,16 @@ | ||
const handleClickOutside = e => { | ||
if (tzRef.current && !tzRef.current.contains(e.target)) { | ||
setShowList(false); | ||
} | ||
}; | ||
useEffect(() => { | ||
document.addEventListener("click", handleClickOutside); | ||
return () => { | ||
document.removeEventListener("click", handleClickOutside); | ||
}; | ||
}, []); | ||
useEffect(() => { | ||
if (showList && tzListRef.current) { | ||
@@ -115,3 +129,3 @@ tzListRef.current.focus(); | ||
return ( | ||
<div className={theme.classBuilder("timezone-selector")}> | ||
<div className={theme.classBuilder("timezone-selector")} ref={tzRef}> | ||
<button | ||
@@ -118,0 +132,0 @@ className={theme.classBuilder("timezone-selector--button")} |
@@ -291,3 +291,3 @@ const moment = require("moment-timezone"); | ||
export const getMonthsDescription = days => { | ||
export const getMonthsDescription = (days, locale) => { | ||
const coverage = days | ||
@@ -297,4 +297,4 @@ .map(day => moment.utc(day, "YYYY-MM-DD")) | ||
(acc, curr) => { | ||
acc.months.push(curr.format("MMM")); | ||
acc.years.push(curr.format("YYYY")); | ||
acc.months.push(curr.locale(locale).format("MMM")); | ||
acc.years.push(curr.locale(locale).format("YYYY")); | ||
return acc; | ||
@@ -301,0 +301,0 @@ }, |
@@ -694,3 +694,3 @@ import moment from "moment-timezone"; | ||
export const getAllLabels = ({ days, limits, tzid, i18n }) => { | ||
export const getAllLabels = ({ days, limits, tzid, i18n, locale }) => { | ||
// For each week that the AV could potentially show we | ||
@@ -737,3 +737,3 @@ // want to calculate: | ||
...week, | ||
month: getMonthsDescription(simpleDaysArray), | ||
month: getMonthsDescription(simpleDaysArray, locale), | ||
}; | ||
@@ -740,0 +740,0 @@ }); |
@@ -96,2 +96,3 @@ import React from "react"; | ||
demo: true, | ||
locale: "en", | ||
}; | ||
@@ -98,0 +99,0 @@ |
@@ -1570,2 +1570,3 @@ import * as utils from "../src/js/helpers/utils.AvailabilityViewer"; | ||
}, | ||
locale: "en", | ||
}; | ||
@@ -1572,0 +1573,0 @@ const allLabels = utils.getAllLabels(options); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
3470183
23214
2