Our pure JavaScript Scheduler component


Post by filipirafael »

Hello everyone, everything good?

I didn't understand in the documentation how I can configure the timeline to show only 4 weeks or 3 months, for example.

My scheduler is configured as per the following code:

scheduler.viewPreset = 'dayAndMonth';

I just need to configure it to show only three months or in case the viewPreset is "weekAndDayLetter", show only four weeks, you know?

Thank you very much!


Post by filipirafael »

Hi everyone, do you need any more information?


Post by johan.isaksson »

Hi,

Sorry for the delayed response.

You can control the time the schedule spans by assigning to scheduler.startDate or scheduler.endDate, or by calling scheduler.setTimeSpan(start, end) (https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#function-setTimeSpan)

If you want to set a specific span for a certain preset, you could listen for the presetChange event (https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#event-presetChange) and adjust the span in your listener.

You could also take a look at the ViewPresetCombo (https://bryntum.com/products/scheduler/docs/api/Scheduler/widget/ViewPresetCombo). It supports presets with start and end specified. See for example the drag-batches demo: https://bryntum.com/products/schedulerpro/examples/drag-batches/

Best regards,
Johan Isaksson

Post by filipirafael »

It works now, thaks a lot Johan!


Post Reply