Leave at 100% for full-time employees. Change if calculating part-time pro-rata.
Days Employed/Covered:–
Days in Year:–
Exact Entitlement:–
Rounded Entitlement (Nearest 0.5):–
function calculateProRataLeave() {
// 1. Get DOM elements
var fullEntitlementInput = document.getElementById('fullEntitlement');
var startDateInput = document.getElementById('startDate');
var endDateInput = document.getElementById('endDate');
var fteInput = document.getElementById('ftePercent');
var resDaysEmployed = document.getElementById('resDaysEmployed');
var resTotalDays = document.getElementById('resTotalDays');
var resExact = document.getElementById('resExact');
var resRounded = document.getElementById('resRounded');
var resultBox = document.getElementById('resultBox');
var dateError = document.getElementById('dateError');
// 2. Parse values
var entitlement = parseFloat(fullEntitlementInput.value);
var startStr = startDateInput.value;
var endStr = endDateInput.value;
var fte = parseFloat(fteInput.value);
// 3. Validation
dateError.style.display = "none";
if (isNaN(entitlement) || !startStr || !endStr) {
alert("Please fill in the Annual Entitlement and both Dates.");
return;
}
if (isNaN(fte) || fte <= 0) {
fte = 100;
}
var startDate = new Date(startStr);
var endDate = new Date(endStr);
// Reset hours to ensure clean day calculation
startDate.setHours(0,0,0,0);
endDate.setHours(0,0,0,0);
if (endDate < startDate) {
dateError.style.display = "block";
resultBox.style.display = "none";
return;
}
// 4. Calculate Days Employed (Inclusive of start and end date)
var oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds
var diffDays = Math.round(Math.abs((endDate – startDate) / oneDay)) + 1;
// 5. Determine Days in Year (Leap Year Logic)
// Logic: Use the year of the start date to determine total days divisor
var year = startDate.getFullYear();
var daysInYear = 365;
// Check leap year: Divisible by 4, unless divisible by 100 but not 400
if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
daysInYear = 366;
}
// 6. Calculate Pro Rata
// Formula: (Days Employed / Days in Year) * Annual Entitlement * (FTE / 100)
var portionOfYear = diffDays / daysInYear;
var fteRatio = fte / 100;
var exactLeave = portionOfYear * entitlement * fteRatio;
// 7. Rounding (Round up to nearest 0.5 is standard HR practice in many regions,
// but here we will round to nearest 0.5 mathematically)
var roundedLeave = Math.round(exactLeave * 2) / 2;
// 8. Update UI
resDaysEmployed.innerText = diffDays + " days";
resTotalDays.innerText = daysInYear + " days (" + year + ")";
resExact.innerText = exactLeave.toFixed(3) + " days";
resRounded.innerText = roundedLeave.toFixed(1) + " days";
resultBox.style.display = "block";
}
What is Pro-Rata Leave?
Pro-rata leave refers to the calculation of holiday entitlement for employees who have not worked a full leave year. This typically applies to new starters who join part-way through a year, employees who leave before the year ends, or part-time workers whose entitlement is calculated based on a full-time equivalent (FTE).
Standard annual leave policies allocate a specific number of days per year (e.g., 28 days including public holidays). When an employee's employment period does not cover the full 12 months, the law and company policy usually dictate that they are entitled to a proportion of that leave equal to the proportion of the year they were employed.
How the Calculation Works
The most accurate method to calculate pro-rata leave is based on the number of days employed versus the total days in the year. The formula used in the calculator above is:
Formula:
(Days Employed ÷ Days in Year) × Annual Leave Entitlement
If the employee is also part-time (working fewer days than the standard week), you apply the Full Time Equivalent (FTE) percentage to this result.
Days Employed: The inclusive count of days from the start date to the end date.
Days in Year: Usually 365, or 366 during a leap year.
Annual Entitlement: The total days a full-year employee would receive.
Example Scenarios
Scenario 1: New Starter
John joins a company on July 1st. The company leave year runs from January 1st to December 31st. The full entitlement is 20 days.
Days employed (July 1 to Dec 31): 184 days.
Calculation: (184 ÷ 365) × 20 = 10.08 days.
Result: John is entitled to approximately 10 days of leave for the remainder of the year.
Scenario 2: Employee Leaving
Sarah resigns and her last day is March 31st. Her full entitlement is 25 days.
Days employed (Jan 1 to Mar 31): 90 days.
Calculation: (90 ÷ 365) × 25 = 6.16 days.
Result: Sarah has accrued roughly 6 days. If she has taken more than this, she may need to repay the company; if she has taken less, she should be paid in lieu.
Important Considerations
Rounding: The law regarding rounding varies by jurisdiction. In the UK, for example, you cannot round down statutory leave entitlement, but many companies round up to the nearest half-day or full day for administrative simplicity.
Leap Years: If the leave year includes February 29th, the total days in the year should be considered 366, slightly altering the daily accrual rate. This calculator automatically detects leap years based on the start date provided.