The toString() method returns a formatted string representation of the duration.
DayPilot.Duration.toString([pattern])pattern (string, optional) - output format string
Returns the formatted string representation of the duration.
If pattern is not specified, the default format is days.hours:minutes:seconds.milliseconds.
The following pattern elements are supported:
s - seconds
mm - two-digit minutes (zero-padded)
m - minutes
h, H - hours
d - days
const duration = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:30:15");
const text = duration.toString();