Our pure JavaScript Scheduler component


Post by tbk »

Hi, I've been working with bryntum scheduler and wanted to show weeks in header but also have timespan of one month shown. So I have this config:

{
name: 'Planner Month View',
    base: 'dayAndMonth',
    tickWidth: 50,
    shiftUnit: PLANNER_SHIFT_UNITS[PLANNER_PRESET_MONTH_ID], // ENUM
    shiftIncrement: 1,
    timeResolution: { ...timeResolution },
    headers: [
      {
        unit: 'month',
        dateFormat: 'MMMM',
      },
      {
        unit: 'week',
        dateFormat: 'WWp0',
      },
      {
        unit: 'day',
        dateFormat: 'dd DD',
      },
    ],
  },

But the issue is when I have week added in headers array the scheduler looks like this (showing more then one month):
Image

But I want to have only one month visible like this (this is when I have headers without object with unit: 'week'):
Image

Currently I'm telling scheduler to show month by saying .setTimeSpan(startDate, endDate)


Post by fabio.mazza »

Hello, by default, time axis "snaps" to show full units, try autoAdjustTimeAxis: false https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#config-autoAdjustTimeAxis.
I've tried your viewPreset config in this example https://bryntum.com/products/scheduler/examples/timeranges/ and when clicking the left and right buttons, they shift correctly with autoAdjustTimeAxis: false config.

Best regards,
Fabio


Post by tbk »

Oh thanks! It worked. I oversaw this property. Thanks once more.


Post Reply