The DayPilot.Duration constructor creates a time span value from a millisecond count or from two date/time values.
new DayPilot.Duration(milliseconds)new DayPilot.Duration(start, end)milliseconds (number) - duration in milliseconds
start (DayPilot.Date | string) - start date/time value
end (DayPilot.Date | string) - end date/time value
When you use the two-parameter form, both ISO 8601 strings and DayPilot.Date objects are supported.
One minute specified using milliseconds:
const minute = new DayPilot.Duration(1000 * 60);Difference between two dates:
const days = new DayPilot.Duration("2025-01-01", "2025-01-05");