Javascript to calculate number of leaves based on start and end date