schedule for weeks
This commit is contained in:
@ -17,16 +17,32 @@ class Schedule {
|
||||
|
||||
drawBackgroundDay = function(ctx, width, height, offsetx) {
|
||||
var hourHeight = parseInt(height / 24);
|
||||
var fs = ["#eeeeee", "#bbbbbb", "#eeeeee", "#bbbbbb", "#eeeeee", "#bbbbbb",
|
||||
"#faf0fa", "#d9cbd9", "#faf0fa", "#9acbd9", "#cdf0fa", "#9acbd9",
|
||||
"#cdf0fa", "#9acbd9", "#cdf0fa", "#d9cbd9", "#faf0fa", "#d9cbd9",
|
||||
"#faf0fa", "#d9cbd9", "#eeeeee", "#bbbbbb", "#eeeeee", "#bbbbbb"];
|
||||
for (var i = 0; i < 24; i++) {
|
||||
var x = parseInt(offsetx);
|
||||
var y = parseInt(i * hourHeight);
|
||||
var w = parseInt(width);
|
||||
var h = parseInt(hourHeight);
|
||||
ctx.fillStyle = (i > 8 & i <= 17) ? (i % 2 ? "#cdf0fa" : "#9acbd9") : (i % 2 ? "#faf0fa" : "#d9cbd9");
|
||||
ctx.fillStyle = fs[i];
|
||||
ctx.fillRect(x, y, w, h);
|
||||
}
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeStyle = "white";
|
||||
ctx.strokeRect(offsetx, 0, width, height);
|
||||
ctx.strokeStyle = "black";
|
||||
ctx.lineWidth = 2;
|
||||
ctx.moveTo(parseInt(offsetx), parseInt(hourHeight * 6));
|
||||
ctx.lineTo(parseInt(offsetx + width), parseInt(hourHeight * 6));
|
||||
ctx.stroke();
|
||||
ctx.moveTo(parseInt(offsetx), parseInt(hourHeight * 12));
|
||||
ctx.lineTo(parseInt(offsetx + width), parseInt(hourHeight * 12));
|
||||
ctx.stroke();
|
||||
ctx.moveTo(parseInt(offsetx), parseInt(hourHeight * 18));
|
||||
ctx.lineTo(parseInt(offsetx + width), parseInt(hourHeight * 18));
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
drawBackgroundWeek = function(ctx, width, height) {
|
||||
|
Reference in New Issue
Block a user