@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
9 lines (8 loc) • 1.51 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
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),u=require("@progress/kendo-react-dateinputs"),r=require("@progress/kendo-date-math"),d=require("../context/SchedulerContext.js");function g(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const D=g(l),f=e=>{const{as:n=C.as,value:t,onChange:o,...c}=e,{timezone:a}=d.useSchedulerPropsContext(),s=i=>{o&&o({value:p(i.target.value,a)})};return D.createElement(n,{...c,value:m(t,a),onChange:s})},m=(e,n)=>{if(e){const t=r.toLocalDate(r.ZonedDate.fromLocalDate(e,n).toUTCDate());return t.setUTCFullYear(e.getFullYear()),t}return e},p=(e,n)=>{if(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),r.ZonedDate.fromUTCDate(t,n).toLocalDate()}return e},C={as:u.DateTimePicker};exports.ZonedDateTime=f;