We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to set Gantt datepicker week start day

Hello,

How do I set start day of the week in datepicker in gantt while editing?

Right now I've got something like in the attachment (week starts at N which stands for Saturday). I want the week to be starting on monday. It's pretty straightforward on standard on ejDatePicker, but I don't see at official documentation any option to set start day in date picker embedded in Gantt.


Thank you,
Michal

3 Replies

SR Suriyaprasanth Ravikumar Syncfusion Team October 4, 2017 09:17 AM UTC

Hi Michal, 
 
In Gantt, we have a column property called “editParams” to customize the editing controls like date picker, numeric textbox, dropdownlist etc. Using this property, we can customize the date picker API in the load event. 
In DatePicker, we have an API’s called “startDay” which is used to set the start day of the week. 
Please refer the code snippet below. 
$("#GanttContainer").ejGantt({ 
                dataSource: weekData, 
                 //.. 
                load: function () { 
                    var column = this.getColumns(); 
                        column[2].editParams={} 
                        column[2].editParams.startDay = 1; 
                } 
            }); 
 
 
We have prepared a sample for your reference, please find the sample from the below link. 
 
And also we can specify the start day of the week in week timescale mode by setting the day count value to the “scheduleHeaderSettings.weekStartDay” property. 
This property was used to changes week start day in Gantt timescale and date picker controls. 
Please refer the code snippet below. 
$("#GanttContainer").ejGantt({ 
                dataSource: weekData, 
                 //.. 
                scheduleHeaderSettings: { 
                    scheduleHeaderType: ej.Gantt.ScheduleHeaderType.Week, 
                          weekStartDay: 2 
                }, 
            }); 
 
 
We have prepared a sample for your reference, please find the sample from the below link. 
 
Please let us know if you require any other assistance on this. 
 
Thanks, 
Suriyaprasanth R. 



MC Michal Cywinski October 4, 2017 10:26 AM UTC

Thank you very much, your solution works perfectly.



SR Suriyaprasanth Ravikumar Syncfusion Team October 5, 2017 12:37 PM UTC

Hi Michal, 
 
Thanks for the update.  
Please let us know if you need any other assistance.  
 
Regards,  
Suriyaprasanth R. 


Loader.
Up arrow icon