Opened 7 years ago
Closed 5 years ago
#17834 closed defect (patchwelcome)
dojo gantt chart calendar starts from sunday
Reported by: | manju | Owned by: | JayZ(zhouxiang) |
---|---|---|---|
Priority: | undecided | Milestone: | 1.13 |
Component: | Dojox | Version: | 1.9.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
hi Dojo gantt chart calendar starts from Sunday and ends with saturday. this dates are not sinking with weekend highlighted by dojox ganttChart. is it a bug or i need to change something? please refer below URL and screenshot http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/gantt/tests/test_Gantt.html Thanks
Attachments (1)
Change History (7)
Changed 7 years ago by
Attachment: | dojo_gantt_chart.jpg added |
---|
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Component: | General → Dojox |
---|---|
Owner: | set to JayZ(zhouxiang) |
Status: | new → assigned |
comment:3 Changed 7 years ago by
Hmm... I don't understand your screen shot. It says "Feb 17 th 2012 is Sunday", which it's not. I guess you really mean June, as this is also the active month in the screen shot.
comment:4 Changed 7 years ago by
The error is in addDayInPanelTime (https://github.com/dojo/dojox/blob/1.9.3/gantt/GanttChart.js#L929), where the weekend is checked by doing date.getDay() >= 5
, however Saturday is represented by 6 and Sunday by 0 (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay), so the current implementation will always mark Friday and Saturday as the weekend.
The fix is probably just to change (date.getDay() >= 5)
to (date.getDay() == 0 || date.getDay() == 6)
.
comment:5 Changed 7 years ago by
i have tried the above code. Now dates are sinking with weekend highlighted by dojox ganttChart. but still i am not able to add saturday as weekend.
we can add either sunday or saturday as weekend but not both.
so please let me know how to get saturday and sunday as weekends with dates sinking with calendar
Thanks Manjunath
comment:6 Changed 5 years ago by
Milestone: | tbd → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | assigned → closed |
Given that no one has shown interest in creating a patch in more than a year, I'm closing this as patchwelcome. Please let us know if you would like to get involved in helping make this change to Dojo!
#17833 is a duplicate of this ticket.