Dhtmlx Calendar not showing days correctly

I am having a weird issue displaying the weekdays.
As you can see in example below the weekdays are a day off… furthermore the weekend coloring is not displaying correctly…
I am using v.3.6 build 131108


Any help would be appreciated…

var d0 = first.getDay(); on line 410 in dhtmlxcalendar.js
If I change this to var d0 = first.getDay()-1; the component is displaying correctly… however there must be a better fix to this… It appears as if function getDay() is not retrieving the right value…

Thanx in advance…

Hello
Could you clarify your question? May be you can attach 2 images with marked part of correct and incorrect behaviour?