gantt
gantt copied to clipboard
[Feature Request] add indicator for current date
would be great! Still missing this feature, anybody else?
Isn't this already there? I think it was extremely light, almost unnoticeable - it's better now with #393.
I've added this feature. Will share it as soon as possible.
make_grid_highlights() {
// highlight today's date
if (this.view_is(VIEW_MODE.DAY) || this.view_is(VIEW_MODE.MONTH)) {
const x =
date_utils.diff(date_utils.today(), this.gantt_start, 'hour') /
this.options.step *
this.options.column_width;
const y = 0;
const width = this.view_is(VIEW_MODE.DAY) ? this.options.column_width : this.options.column_width / date_utils.get_days_in_month(date_utils.today());
const height =
(this.options.bar_height + this.options.padding) *
this.tasks.length +
this.options.header_height +
this.options.padding / 2;
createSVG('rect', {
x,
y,
width,
height,
class: 'today-highlight',
append_to: this.layers.grid,
style: 'fill: red;'
});
}
}
We already have a good current date indicator.