ganttDrawerSVG.js 下 createHeadCell 创建头部单元格
这里形成用于两个头部代元格的形成
- 月份形成
- 一个月的每周,每天的单元格
如果要将现有的英文改成 中文需要加上判断
如下
/*
* sam modify : 将周六 到日,进行中文的替换
*/
Ganttalendar.prototype.createHeadCell = function (level, zoomDrawer, rowCtx, lbl, span, additionalClass, start, end) {
console.log("createHeadCell lbl", lbl);
if (lbl === "S") {
lbl = "六";
} else if (lbl === "M") {
lbl = "一";
}else if (lbl === "T") {
lbl = "二";
}
var x = (start.getTime() - self.startMillis)* zoomDrawer.computedScaleX;
var th = $("<th>").html(lbl).attr("colSpan", span);
if (level>1) { //set width on second level only
var w = (end.getTime() - start.getTime()) * zoomDrawer.computedScaleX;
th.width(w);
}
if (additionalClass)
th.addClass(additionalClass);
rowCtx.append(th);
};
结果是