when I want to display an event, for example [2017-04-01 , 2017-04-05], I want to find the number of day = 5 instead 4, the problem it's not in 05, it's 01, 02, 03, 04
DayPilot interprets the dates in your example as "2017-04-01T00:00:00" and "2017-04-05T00:00:00" - that should explain the default behavior.
You can switch the behavior using eventEndSpec property: eventEndSpec="Date" will interpret the end date as date-only (rather than date/time):
https://doc.daypilot.org/scheduler/event-end-date-time/