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.

Hello,

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.

thankyou

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:
https://api.daypilot.org/daypilot-date-class/

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