GetCellElements fails if range starts in a month and end in the next month

6 replies. Last post: June 22, 2010 12:27 PM by Andi Santoso
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi all,

I want to color days since 2010-03-29 till 2010-04-03, I used the code below:

function SetBackgroundColor(elements, color, isHourArea) {
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
if (el != null) {
if (isHourArea) {
el.children[0].style.backgroundColor = color;
}
else {
el.style.backgroundColor = color;
}
}
}
}

function WebScheduler1_OnAfterRenderView(controlId, viewMode) {
var WebScheduler1 = ISGetObject(controlId);

var isHourArea = viewMode != "Timeline";

var arr = new ISArray();
arr.Add(new WebSchedulerDateRange(new Date(2010, 2, 29, 0, 0, 0, 0), new Date(2010, 3, 3, 0, 0, 0, 0),
1, "DateTime"));
var elements = WebScheduler1.GetCellElements(arr);
SetBackgroundColor(elements, "#555500", isHourArea);

return true;
}

I have problems with Week, Quarter and Year view, look at the screen shots:

  • in the quarter view: 28 of March should not be colored, and the color is also outside March
  • in the year view: 28 of March should not be colored, the color is also outside March and 1 and 2 of April are not colored
  • in the week view: 2 of April is not colored

Could someone help me?

Thanks in advance,

Vince

All times are GMT -5. The time now is 12:41 AM.
Previous Next