gantt-task-react icon indicating copy to clipboard operation
gantt-task-react copied to clipboard

Extend date task to end of the day

Open javanocollins opened this issue 2 years ago • 2 comments

Is there a way to extend the to/end date bar to the end of the day? Screen Shot 2022-05-29 at 16 27 00 PM

javanocollins avatar May 29 '22 20:05 javanocollins

The bar ends at the beginning of June 3rd

javanocollins avatar May 29 '22 20:05 javanocollins

The outcome can be attained by adding hours to date.

I changed the end code snippet date, by the way.

Before:

const tasks: Task[] = timeoffs.map(timeoff => {
    return {
      start: new Date(timeoff.start_date),
      end: new Date(timeoff.end_date),
      name: timeoff.user.full_name,
      id: timeoff.id,
      type: 'task',
      isDisabled: true,
      styles: {
        backgroundColor: '#333366',
        backgroundSelectedColor: '#ff6633'
      }
    };
  });

After:

const tasks: Task[] = timeoffs.map(timeoff => {
    return {
      start: new Date(timeoff.start_date),
      end: new Date(new Date(timeoff.end_date).setHours(23, 59)),
      name: timeoff.user.full_name,
      id: timeoff.id,
      type: 'task',
      isDisabled: true,
      styles: {
        backgroundColor: '#333366',
        backgroundSelectedColor: '#ff6633'
      }
    };
  });

javanocollins avatar May 29 '22 20:05 javanocollins