search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to manage dates in Gantt Chart View.

Asked by Bikram Jeet Singh
1 year ago.


I am working on a project where I am passing the date as:
new Date(PlannedStartDate) or new DayPilot.Date(PlannedStartDate)

The date being passed is 15th Feb, but the task is appearing in little bit in 14th feb cell and is snapping to the grid,
how can I format the date that it starts from 15th feb cell.


Answer posted by Dan Letecky [DayPilot]
1 year ago.

You can either use a string value (such as "2023-02-15" or "2023-02-15T00:00:00") which will be converted to an exact date.

const date = new DayPilot.Date("2023-02-15T00:00:00");

If you have a Date object and want to use its local representation when converting it to DayPilot.Date, you need to do it like this:

const now = new Date();
const date = new DayPilot.Date(now, true);

For more details on date conversions, please see here:

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.