This commit is contained in:
Deepak Kyatham 2024-03-26 16:34:04 +05:30
parent 6cb5c12fb7
commit 02aaf6a02f

View File

@ -412,6 +412,7 @@ export default class Gantt {
} }
} }
//compute the horizontal x distance
computeGridHighlightDimensions(view_mode) { computeGridHighlightDimensions(view_mode) {
let xDist = 0; let xDist = 0;
@ -424,7 +425,7 @@ export default class Gantt {
for (let date of this.dates) { for (let date of this.dates) {
const todayDate = new Date(); const todayDate = new Date();
const startDate = new Date(date); const startDate = new Date(date);
let endDate = new Date(date); const endDate = new Date(date);
switch (view_mode) { switch (view_mode) {
case VIEW_MODE.WEEK: case VIEW_MODE.WEEK:
endDate.setDate(date.getDate() + 7); endDate.setDate(date.getDate() + 7);
@ -436,7 +437,6 @@ export default class Gantt {
endDate.setFullYear(date.getFullYear() + 1); endDate.setFullYear(date.getFullYear() + 1);
break; break;
} }
if (todayDate >= startDate && todayDate <= endDate) { if (todayDate >= startDate && todayDate <= endDate) {
break; break;
} else { } else {
@ -447,13 +447,11 @@ export default class Gantt {
} }
make_grid_highlights() { make_grid_highlights() {
// highlight today's | week's date // highlight today's | week's | month's | year's
if (this.view_is(VIEW_MODE.DAY) || this.view_is(VIEW_MODE.WEEK) || this.view_is(VIEW_MODE.MONTH) || this.view_is(VIEW_MODE.YEAR)) { if (this.view_is(VIEW_MODE.DAY) || this.view_is(VIEW_MODE.WEEK) || this.view_is(VIEW_MODE.MONTH) || this.view_is(VIEW_MODE.YEAR)) {
let x = this.computeGridHighlightDimensions(this.options.view_mode); const x = this.computeGridHighlightDimensions(this.options.view_mode);
const y = 0; const y = 0;
const width = this.options.column_width; const width = this.options.column_width;
const height = const height =
(this.options.bar_height + this.options.padding) * (this.options.bar_height + this.options.padding) *