Our state of the art Gantt chart


Post by daniel.piret »

Hello,

Certain customers have their weekends on Fri and Sat and working days goes from Sunday to Thursday, we have tried to change the calendar from this:

				"intervals": [{
					"recurrentStartDate": "on Sat at 0:00",
					"recurrentEndDate": "on Mon at 0:00",
					"isWorking": false
				},

to this:

				"intervals": [{
					"recurrentStartDate": "on Fri at 0:00",
					"recurrentEndDate": "on Sun at 0:00",
					"isWorking": false
				},

But now the Gantt Calendar shows Friday, Saturday and Sunday as grey (non-working days), if I add a task starting on Thursday with duration 2 days it starts on Thursday and finish on Monday, as the non-working day is selected as Fri/Sat I would expect that it should be completed on Sunday, so how do I change the default weekends?

I cannot find in the documentation how to change the default Weekends, can you point me in the right direction please?

Thanks


Post by mats »

Did you read this guide about Calendars?

https://bryntum.com/docs/gantt/#guides/calendars.md


Post by daniel.piret »

Yes, and it does not specify how to handle weekends, but non-working days, and if I set the working days as explained before the saturday and Sunday are still displaying as weekend no matter what I do, what am I missing here?

here is the calendar I'm using:

	"calendars" : {
		"rows" : [
			{
				"id"        : "general",
				"name"      : "General",
				"intervals": [{
					"recurrentStartDate": "on Fri at 0:00",
					"recurrentEndDate": "on Sun at 0:00",
					"isWorking": false
				},
				{
					"recurrentStartDate" : "every weekday at 12:00",
					"recurrentEndDate"   : "every weekday at 13:00",
					"isWorking"          : false
				},
				{
					"recurrentStartDate" : "every weekday at 17:00",
					"recurrentEndDate"   : "every weekday at 08:00",
					"isWorking"          : false
				}]
			}
		]
	},

Post by daniel.piret »

After fiddling a bit with the options we found a solution for the Arabic calendars, thanks for your help


Post by arcady »

The reason why Sat and Sun are still non-working is this interval:

{
    "recurrentStartDate" : "every weekday at 17:00",
    "recurrentEndDate"   : "every weekday at 08:00",
    "isWorking"          : false
}

It's explained here in "Recurrent intervals" chapter:

The above two intervals also make Saturday and Sunday non working days. It happens since on Friday they add a non working interval starting at 17:00 (due to every weekday at 17:00 rule) which finishes only on Monday at 08:00 (due to every weekday at 08:00 rule, where weekday does not include Sat nor Sun so the next matching time is Mon 08:00).

You could define intervals in a different way:

{
    "recurrentStartDate" : "at 12:00 on Sat,Sun,Mon,Tue,Wed",
    "recurrentEndDate"   : "at 13:00 on Sat,Sun,Mon,Tue,Wed",
    "isWorking"          : false
},
{
    "recurrentStartDate" : "at 17:00 on Sat,Sun,Mon,Tue,Wed",
    "recurrentEndDate"   : "at 08:00 on Sat,Sun,Mon,Tue,Wed",
    "isWorking"          : false
}

That literally enumerates Sat,Sun,Mon,Tue,Wed non-working periods. And missed Thu and Fri become non-working due this interval:

{
    "recurrentStartDate" : "at 17:00 on Sat,Sun,Mon,Tue,Wed",
    "recurrentEndDate"   : "at 08:00 on Sat,Sun,Mon,Tue,Wed",
    "isWorking"          : false
}

On Wed it starts at 17:00 and finishes at 08:00 at the next matching day from the list which is Sat.
Please check Later docs for details on syntax.


Post Reply