Our pure JavaScript Scheduler component


Post by Fred »

Hello,
the business case I'm working on requires to create pre-built event of fixed duration and let user position it where a set of rules would allow him/her to do put it. Problem is how to deal with days off ?

For instance, suppose the event is 3 days long. If the user puts it on Tuesday, then the event will take Tuesday, Wednesday and Thursday. But if the user puts it on Friday, then I'd want the event to take Friday, Monday and Tuesday. And eventually Saturday and Sunday that don't count.

Same problem arises with non working days such as Dec. 25.

How can I do that ?
Thanks


Post by mats »

Did you read this guide? Should contain all you need to know: https://bryntum.com/docs/gantt/#guides/calendars.md


Post by Fred »

Nope, I looked in Scheduler doc and not in the Gantt one.
So I modified the loaded json to hide week-ends and holidays as follow:

{
    "success"   : true,

"project" : {
    "calendar"     : 9999,
    "hoursPerDay"  : 8,
    "daysPerWeek"  : 5,
    "daysPerMonth" : 20
},

"calendars" : {
    "rows" : [
        {
            "id"        : 9999,
            "name"      : "My calendar",
            "intervals" : [
                {
                    "id"                 : 123,
                    "recurrentStartDate" : "every weekday at 12:00",
                    "recurrentEndDate"   : "every weekday at 13:00",
                    "isWorking"          : false
                },
                {
                    "id"                 : 456,
                    "recurrentStartDate" : "every weekday at 17:00",
                    "recurrentEndDate"   : "every weekday at 08:00",
                    "isWorking"          : false
                },
                {
                    "id"                 : 789,
                    "startDate"          : "2020-11-11",
                    "endDate"            : "2020-11-11",
                    "isWorking"          : false,
                    "name"               : "armistice"
                }
            ]
        }
    ]
},

"resources" : {
...

In the scheduler I set :

const scheduler = new Scheduler({
    hideNonWorkingDays: true,
    ...

But I can still see week-ends and holidays. Which would be OK as long as when I move events, they automatically adjust to take non working days into account. For instance, if I move the 3 days event on Nov 9, I expect this event to take 4 cells: 9, 10, 11 and 12 because I set Nov 11 as holiday. And because it's nested event, I want Nov 11 to appear grey

Screenshot 2020-11-24 at 00.34.01.png
Screenshot 2020-11-24 at 00.34.01.png (135.8 KiB) Viewed 848 times

No console error though


Post by mats »

Ok Scheduler Pro supports this but not the basic Scheduler. Is it Pro you are using?


Post by Fred »

Hi Mats,
No, I was using the standard scheduler. Downloading the trial pro version now to give it a try.
Will I need to purchase the Bryntum Gantt product as well ? (I saw this calendar feature as part of the Gantt doc)
Thanks


Post by mats »

Nope, Scheduler Pro has the engine from the Gantt which enables defining Calendars / non-working time according to docs. https://bryntum.com/docs/scheduler-pro/#guides/schedulerpro/calendars.md


Post by Fred »

SchedulerPro does the job indeed. This demo helps also :
https://www.bryntum.com/examples/scheduler-pro/weekends/
Thanks


Post Reply