The hours() method returns the hour component of the duration as an integer number of full hours.
DayPilot.Duration.hours()Returns the hour part of the duration. The value contains full hours only, so it is always an integer.
Use DayPilot.Duration.totalHours() when you need the entire duration converted to hours instead of just the hour component.
const hours = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:30:00").hours(); // 12DayPilot.Duration.totalHours()
External Drag and Drop of Tasks [doc.daypilot.org]