UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

18 lines (17 loc) 819 B
/** * DevExtreme (esm/renovation/ui/scheduler/timeZoneCalculator/createTimeZoneCalculator.js) * Version: 22.1.9 * Build date: Tue Apr 18 2023 * * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { TimeZoneCalculator } from "./utils"; import timeZoneUtils from "../../../../ui/scheduler/utils.timeZone"; export var createTimeZoneCalculator = currentTimeZone => new TimeZoneCalculator({ getClientOffset: date => timeZoneUtils.getClientTimezoneOffset(date), tryGetCommonOffset: date => timeZoneUtils.calculateTimezoneByValue(currentTimeZone, date), tryGetAppointmentOffset: (date, appointmentTimezone) => timeZoneUtils.calculateTimezoneByValue(appointmentTimezone, date) });