Here you can find the source of getBookingDays(Calendar start, Calendar end)
Parameter | Description |
---|---|
start | pickup date (included) |
end | return date (included) |
public static long getBookingDays(Calendar start, Calendar end)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.concurrent.TimeUnit; public class Main { /**// w ww . j ava 2 s. co m * Returns the entire number of business booking days between two given dates * * @param start pickup date (included) * @param end return date (included) * @return the number of booking days */ public static long getBookingDays(Calendar start, Calendar end) { long diff = end.getTime().getTime() - start.getTime().getTime(); return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS) + 1; } }