Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendars ignored when set as inline data directly to SchedulerPro instance #6898

Closed
chuckn0rris opened this issue May 31, 2023 · 1 comment
Assignees
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed invalid This doesn't seem right

Comments

@chuckn0rris
Copy link

Forum post

In inline-data demo add calendars

const
    schedulerPro = new SchedulerPro({
        appendTo   : 'container',
        startDate  : '2022-03-23',
        endDate    : '2022-03-24',
        viewPreset : 'hourAndDay',
        // forceFit   : true,
        columns    : [
            {
                type           : 'resourceInfo',
                text           : 'Name',
                field          : 'name',
                showEventCount : false,
                width          : 150
            }
        ],

        resources    : data.resources,
        events       : data.events,
        assignments  : data.assignments,
        dependencies : data.dependencies,
        calendars : [
            {
              id: 'weekends',
              name: 'Weekends',
              // Intervals to define all SA and SU as non-working days
              intervals: [
                {
                  recurrentStartDate: 'on Sat at 0:00',
                  recurrentEndDate: 'on Mon at 0:00',
                  isWorking: false,
                },
              ],
            },
          ],
          calendar : 'weekends'
    });

See there are no non-working time highlighted. Try to set all the same using project config. All works as expected.

@chuckn0rris chuckn0rris added bug Something isn't working forum Issues from forum labels May 31, 2023
@isglass isglass added the high-priority Urgent to have fixed label May 31, 2023
@canonic-epicure canonic-epicure self-assigned this Jun 6, 2023
@canonic-epicure
Copy link

canonic-epicure commented Jun 6, 2023

Calendars are not ignored, its just that Scheduler has no calendar config, so assigning to it does nothing and scheduler ends up w/o a calendar - thus nothing is highlighted. Calendar needs to be assigned to the project.

For example this works:

const
    schedulerPro = window.schedulerPro = new SchedulerPro({
        appendTo : 'container',
        startDate : '2022-03-23',
        endDate : '2022-04-24',
        forceFit : true,
        columns : [
            {
                type : 'resourceInfo',
                text : 'Name',
                field : 'name',
                showEventCount : false,
                width : 150
            }
        ],

        // project : {
        resources : data.resources,
        events : data.events,
        assignments : data.assignments,
        dependencies : data.dependencies,
        calendars : [
            {
                id : 'weekends',
                name : 'Weekends',
                // Intervals to define all SA and SU as non-working days
                intervals : [
                    {
                        recurrentStartDate : 'on Sat at 0:00',
                        recurrentEndDate : 'on Mon at 0:00',
                        isWorking : false,
                    },
                ],
            },
        ],
        project : {
            calendar : 'weekends'
        }
    });

@canonic-epicure canonic-epicure added invalid This doesn't seem right and removed in progress labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants