@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
26 lines (25 loc) • 910 B
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 { ZonedDate as s } from "@progress/kendo-date-math";
const f = (t, { step: o, timezone: a }) => {
const r = [], m = s.fromLocalDate(t.start, a), g = s.fromLocalDate(t.end, a);
for (let e = m.clone(), c = 0; e.getTime() < g.getTime(); c++, e = e.addTime(o)) {
const n = e.clone(), d = n.clone().addTime(o), i = new Date(n.getTime()), l = new Date(d.getTime()), T = {
index: c,
end: l,
start: i,
zonedStart: n,
zonedEnd: d
};
r.push(T);
}
return r;
};
export {
f as toRanges
};