Problem about leave days

I have a problem when the employee chooses the leave date between Monday and other day in the week. It turns out that the number of leave days is wrong. The number of days will always disappear one day. Let say if choose leave days from 1 April 19 to 3 April 19, number of leave days should be 3 days but the program shows only 2.

Pièces jointes :

Dolibar uses Julian days which starts at 12 Hrs UTC.
I bypassed the problem by using $jour_semaine = gmdate(‘w’, $timestampStart); instead of $jour_semaine = jddayofweek($jour_julien, 0); in file /core/lib/date.lib.php
But this logic is very irritating and took a lot of time to debug.