The days() method returns the day component of the duration as an integer number of full days.
DayPilot.Duration.days()Returns the day part of the duration. The value contains full days only, so it is always an integer.
Use DayPilot.Duration.totalDays() when you need the entire duration converted to days instead of just the day component.
const days = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:00:00").days(); // 4