UNPKG

bardelman-dhtmlx-gantt-redux

Version:

An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.

40 lines (35 loc) 917 B
<!DOCTYPE html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Highlighting weekends</title> <script src="../../codebase/dhtmlxgantt.js?v=9.0.10"></script> <link rel="stylesheet" href="../../codebase/dhtmlxgantt.css?v=9.0.10"> <script src="../common/testdata.js?v=9.0.10"></script> <style> html, body { width: 100%; height: 100%; margin: 0; } .weekend { background: var(--dhx-gantt-base-colors-background-alt); } </style> </head> <body> <div id="gantt_here" style='width:100%; height:100%'></div> <script> gantt.templates.scale_cell_class = function (date) { if (date.getDay() == 0 || date.getDay() == 6) { return "weekend"; } }; gantt.templates.timeline_cell_class = function (item, date) { if (date.getDay() == 0 || date.getDay() == 6) { return "weekend" } }; gantt.init("gantt_here"); gantt.parse(demo_tasks); </script> </body>