cronofy-elements
Advanced tools
Comparing version 1.11.1 to 1.12.0
{ | ||
"name": "cronofy-elements", | ||
"version": "1.11.1", | ||
"version": "1.12.0", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
@@ -155,3 +155,4 @@ import React, { useState, useEffect } from "react"; | ||
res.available_slots, | ||
status.locale | ||
status.locale, | ||
status.tzid | ||
); | ||
@@ -158,0 +159,0 @@ |
@@ -9,3 +9,8 @@ import React, { useContext } from "react"; | ||
import { I18nContext, ThemeContext, SlotsContext } from "./SlotPicker"; | ||
import { | ||
I18nContext, | ||
ThemeContext, | ||
SlotsContext, | ||
StatusContext | ||
} from "./SlotPicker"; | ||
@@ -16,2 +21,3 @@ const TimeSlots = props => { | ||
const slots = useContext(SlotsContext); | ||
const [status] = useContext(StatusContext); | ||
return ( | ||
@@ -76,3 +82,5 @@ <div | ||
{i18n.f( | ||
moment(slots.day, "YYYY-MM-DDTThh:mm:00Z"), | ||
moment(slots.day, "YYYY-MM-DDTThh:mm:00Z").tz( | ||
status.tzid | ||
), | ||
`dddd Do MMMM` | ||
@@ -79,0 +87,0 @@ )} |
@@ -112,3 +112,3 @@ const moment = require("moment-timezone"); | ||
export const arangeSlotsByDay = (days, available_periods, locale) => | ||
export const arangeSlotsByDay = (days, available_periods, locale, tzid) => | ||
days.reduce( | ||
@@ -126,5 +126,7 @@ (acc, day) => ({ | ||
label: `${moment(slot.start) | ||
.tz(tzid) | ||
.locale(locale) | ||
.format("LT") | ||
.replace(" ", "")} - ${moment(slot.end) | ||
.tz(tzid) | ||
.locale(locale) | ||
@@ -131,0 +133,0 @@ .format("LT") |
@@ -290,5 +290,12 @@ import * as slotsHelpers from "../src/js/helpers/slots"; | ||
const result = slotsHelpers.arangeSlotsByDay(days, slots, "en-US"); | ||
const sniffedTimezone = moment.tz.guess(); | ||
const result = slotsHelpers.arangeSlotsByDay( | ||
days, | ||
slots, | ||
"en-US", | ||
sniffedTimezone | ||
); | ||
expect(result).toEqual(expectedResult); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
2469993
21736