@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
45 lines (44 loc) • 1.43 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as m from "react";
import { DateTimePicker as l } from "@progress/kendo-react-dateinputs";
import { toLocalDate as g, ZonedDate as a } from "@progress/kendo-date-math";
import { useSchedulerPropsContext as D } from "../context/SchedulerContext.mjs";
const u = (t) => {
const { as: o = C.as, value: e, onChange: r, ...s } = t, { timezone: n } = D(), c = (i) => {
r && r({ value: f(i.target.value, n) });
};
return /* @__PURE__ */ m.createElement(o, { ...s, value: d(e, n), onChange: c });
}, d = (t, o) => {
if (t) {
const e = g(a.fromLocalDate(t, o).toUTCDate());
return e.setUTCFullYear(t.getFullYear()), e;
}
return t;
}, f = (t, o) => {
if (t) {
const e = new Date(
Date.UTC(
t.getFullYear(),
t.getMonth(),
t.getDate(),
t.getHours(),
t.getMinutes(),
t.getSeconds(),
t.getMilliseconds()
)
);
return e.setUTCFullYear(t.getFullYear()), a.fromUTCDate(e, o).toLocalDate();
}
return t;
}, C = {
as: l
};
export {
u as ZonedDateTime
};