The milliseconds() method returns the millisecond component of the duration.
DayPilot.Duration.milliseconds()Returns the milliseconds part of the duration.
Use DayPilot.Duration.totalMilliseconds() when you need the full duration converted to milliseconds instead of just the millisecond component.
const ms = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:30:15.100").milliseconds(); // 100DayPilot.Duration.totalMilliseconds()