You will need
  • calendar;
  • - information about public holidays and the transfer of output and working days for the current year.
For example, an employee takes a leave for 14 calendar days from 1 may. In this case, don't take his holiday, he would have to go to work, 15 may 2011 - 16 may, because may 15 fell on a Sunday, the exception if the work schedule involves employment and on weekends, or weekend, was postponed for the whole country).
But as the leave the employee falls on two of the public holiday on may 1 and 9, turns out that those two days on leave are not included.
Thus, in this case, the reference that the employee is not starting with 1, and from 2 may, the day that is not a holiday.
May 9, again a holiday, and the expense of the employee is terminated.
It turns out that from 2 to 8 may inclusive it was done on 7, not 9 days. From 10 may, the countdown will start again, and the result is that the worker can rest for another 7 days - until may 16th, inclusive.