The totalDays() method returns the duration converted to days.
DayPilot.Duration.totalDays();
The duration converted to days. If the duration includes hours, minutes, seconds or milliseconds the result will be a fractional number.
var days = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:00:00").totalDays(); // 4.5