How to set weekendFirstDay and weekendSecondDay with Extjs gantt ?
Posted: Tue Aug 20, 2019 8:10 am
by Paras
I need to set weekendSecondDay and weekendFirstDay in my Extjs gantt panel. Where and how should i set the values? I was going through the docs but i could not understand how to use Gnt.data.Calendar.
Thanks,
Paras
Re: How to set weekendFirstDay and weekendSecondDay with Extjs gantt ?
Is this wrong ? Do i need to load calendar store or can i just pass values to make it work? I want wednesday to be WeekendFirstDay .
Re: How to set weekendFirstDay and weekendSecondDay with Extjs gantt ?
Posted: Tue Aug 27, 2019 8:50 pm
by pmiklashevich
Hello,
You create an instance of Gnt.data.Calendar. There is no "data" in its config list. But there are weekendFirstDay, calendarId and so on, and all of them are named in camelCase. You can try it out in our Calendar demo running locally. Please modify examples/calendars/app/view/Gantt.js:
initComponent : function() {
var me = this,
taskStore = new Gnt.data.TaskStore({
// Schedule by constraints
scheduleByConstraints : true,
// Activate logic to warn on:
// - violating dependencies
// - potential scheduling conflicts
checkDependencyConstraint : true,
checkPotentialConflictConstraint : true,
// calendarManager : new Gnt.data.CalendarManager({
// // we will use BusinessTime calendars
// calendarClass : 'Gnt.data.calendar.BusinessTime'
// }),
calendar : new Gnt.data.Calendar({
calendarId : 'test',
name : 'Test',
daysPerWeek : 7,
daysPerMonth : 30,
hoursPerDay : 24,
weekendFirstDay : 3,
weekendSecondDay : 0,
weekendsAreWorkdays : false,
defaultAvailability : [
'00:00-24:00'
]
}),
and remove "projectCalendar" from examples/calendars/data/data.json to do not override specified calendar by another one loaded dynamically
{
"success" : true,
"calendars" : {
// NEED TO REMOVE THIS TO GET VALID JSON
// "metaData" : {
// "projectCalendar" : "general"
// },