bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

MonthView error when `sixWeeks : false, autoRowHeight : true` #8972

Closed marciogurka closed 4 months ago

marciogurka commented 5 months ago

Forum post

"Hello Bryntum Support and Community,

I've encountered an issue in the Bryntum Calendar while working in month view mode. Specifically, when I configure the calendar with autoRowHeight: true and sixWeeks: false, it triggers an error in the console. I'm reaching out for guidance on how to resolve this issue or for any workarounds you might suggest.

Issue Description: Upon setting the calendar to month mode with the properties autoRowHeight: true and sixWeeks: false, an unexpected error is logged in the console. This occurs without any further interaction with the calendar. Related screenshot: Steps to Reproduce: Initialize the Bryntum Calendar in month view mode.

Apply the following configuration options:


javascript
   autoRowHeight: true,
   sixWeeks: false

Observe the error appearing in the browser's console upon loading the calendar.

import { Calendar } from '../../build/calendar.module.js?474872';
import shared from '../_shared/shared.module.js?474872';

const calendar = new Calendar({
    appendTo : 'container',

// Start life looking at this date
date : new Date("2025-02-01"),

sidebar : null,

modes : {
    month : {
        autoRowHeight    : true,
        sixWeeks: false,
    },
},
mode : 'month',

project : {
    eventStore : {
        useRawData : true,
        data       : null
    },
    assignmentStore : {
        data : null
    }
},
});

"

Go to https://bryntum.com/products/calendar/examples/megadataset/, and set sixWeeks:false in month view, and you'll see an error that's triggered

TypeError: Cannot read properties of null (reading 'dataset')
    at MonthView.getWeekContext
marciogurka commented 4 months ago

Still reproducible on live example (5.6.10)

https://github.com/bryntum/support/assets/16693227/edb125ce-8e2d-4950-8549-b5d8a23dc001

ExtAnimal commented 4 months ago

MonthView.js needs this:

Screenshot 2024-05-15 at 11 10 46