Hello guys!
I'm updating Scheduler setting new start and end dates directly to config, but when I setting dates that goes before current dates - I got an error:
Uncaught Error: Invalid start/end dates. Start date must less than end date.
Below code we use.
New startDate received -> New config set with new dates
pretty easy, but we got errors. also dates different with those which we use (or maybe I mistaking)
useEffect(() => {
if (activePlanningCycle?.startDate) {
setConfig({
...config,
startDate: new Date(new Date(activePlanningCycle?.startDate).getTime() - 6.048e8),
endDate: new Date(new Date(activePlanningCycle?.endDate).getTime() + 6.048e8),
});
}
if (batchesData?.batches && routings && activePlanningCycle) {
setBatches(converter(batchesData?.batches, routings, activePlanningCycle));
}
}, [batchesData, activePlanningCycle]);
return batches ? (
<BryntumScheduler
{...config}
events={batches?.events?.rows || []}
resources={batches?.resources?.rows || []}
timeRanges={batches?.timeRanges?.rows || []}
columns={[
{
renderer: (props: any) => {
return props?.record?.data?.name;
},
text: 'Route',
width: '200',
},
]}
/>
I cannot attach screen recording here, but dates sometime really strange