The days() method returns the day part of the duration (number).
DayPilot.Duration.days();
The day part of the duration. It returns the number of full days - it is always an integer value.
var days = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:00:00").days(); // 4