I have the following code that has always been there...
private setupTimeScalePresets(): void {
try {
this.viewPreset = 'hourAndDay';
PresetManager.registerPreset(this.viewPreset, {
tickWidth: 35,
rowHeight: 10,
displayDateFormat: 'HH:mm',
shiftIncrement: 1,
shiftUnit: 'day',
timeResolution: {
unit: 'hour',
increment: 0.08
},
defaultSpan: 24,
headers: {
unit: 'hour',
dateFormat: 'HH:mm'
}
});
} catch (error) {
this.loggerBase.error(`setupTimeScalePresets: ${error}`);
}
}
// 2.3
headerConfig: {
middle: {
unit: 'hour',
increment: 1,
dateFormat: 'HH:mm'
}
}
// 3.1.3
headers: {
unit: 'hour',
dateFormat: 'HH:mm'
}
If I get vscode to break at the exception, this is where it is coming from..."Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method."
Note the argument "o" is undefined.
I am not sure if it is related, but I do currently hide my top timescale column by the following css
/** Hide time scale top row */
.b-sch-header-row-0 {
display: none !important;
}
Funny enough, even with this exception it seems to appear how I want, in fact I remove this code and I still get the result I am after.
I initially added this when I was first looking at the scheduler, and was a little confused with the presets
So I will remove it for now, but just curious as to what I am doing wrong in my call?
Thanks in advance
Later I may want to add different "scalings"