The toDateLocal() method returns a Date object that holds the DayPilot.Date value as a local date.
DayPilot.Date.toDateLocal()Returns a Date object that represents the DayPilot.Date value as a local date/time.
The returned object uses the local time zone of the browser. As shown in the example below, serializing it using toISOString() can produce a different UTC timestamp than the original DayPilot.Date string.
const today = DayPilot.Date.today(); // DayPilot.Date {value: "2018-01-01T00:00:00"}
const todayString = today.toString(); // "2018-01-01T00:00:00"
const localToday = today.toDateLocal(); // Mon Jan 01 2018 00:00:00 GMT+0100 (Central European Standard Time)
const localTodayString = localToday.toISOString(); // "2017-12-31T23:00:00.000Z"