Calculate future dates, lead times, and schedule deadlines precisely.
Add Time to a Date (Find End Date)
Subtract Time from a Date (Find Start Date)
Duration Between Two Dates
Note: Does not account for public holidays.
Resulting Date
—
Day of Week
—
Total Days
—
ISO Week Number
—
What is a Date Wheel Calculator?
A Date Wheel Calculator (often called a scheduling wheel, pregnancy wheel, or lead-time calculator) is a tool used to determine dates based on a specific duration or to calculate the timeframe between two calendar points. Historically, these were physical cardboard wheels consisting of two or more concentric circles that rotated to align dates with weeks or days. This digital version replicates that logic for precise project management, supply chain logistics, and personal scheduling.
Common Uses for Date Wheels
Supply Chain & Logistics: Calculating "Lead Time." If an order is placed on a specific date and takes 6 weeks to ship, the date wheel determines the exact arrival date.
Project Management: Estimating milestones. If a project phase requires 15 business days, the calculator identifies the deadline while accounting for weekends (if selected).
Pregnancy & Medical: Often referred to as an "OB Wheel," this logic is used to calculate estimated due dates (EDD) by adding 40 weeks to the first day of the last menstrual period (LMP).
Legal & Compliance: Determining strict deadlines for filing documents, often defined as "X days after receipt of notice."
How to Use This Calculator
This tool offers three specific modes to handle different scheduling needs:
Add Time to a Date: Select a start date and input the duration (weeks and days). The tool calculates the future date. This is ideal for finding deadlines or delivery dates.
Subtract Time from a Date: Enter a target end date and the duration required. The tool calculates when you must start to meet that deadline. This is known as "backwards scheduling."
Duration Between Dates: Enter a Start Date and an End Date. The tool calculates the exact number of weeks and days between them.
Business Days vs. Calendar Days
By default, date wheels operate on Calendar Days (including Saturdays and Sundays). However, in professional settings, you often need to calculate based on Business Days. Checking the "Exclude Weekends" box in the calculator adjusts the math to skip Saturdays and Sundays, ensuring that a "5-day duration" starting on Friday ends on the following Friday (skipping Sat/Sun), rather than the following Wednesday.
// Initialize default date to today
window.onload = function() {
var today = new Date();
var yyyy = today.getFullYear();
var mm = String(today.getMonth() + 1).padStart(2, '0');
var dd = String(today.getDate()).padStart(2, '0');
document.getElementById('startDate').value = yyyy + '-' + mm + '-' + dd;
toggleDateWheelMode();
};
function toggleDateWheelMode() {
var mode = document.getElementById('calcMode').value;
var divStart = document.getElementById('div-startDate');
var divEnd = document.getElementById('div-endDate');
var divDuration = document.getElementById('div-duration');
var labelStart = document.getElementById('label-startDate');
var divBiz = document.getElementById('div-businessDays');
// Reset visibility
divStart.style.display = 'block';
divEnd.style.display = 'none';
divDuration.style.display = 'flex';
divBiz.style.display = 'block'; // Show by default for add/sub
if (mode === 'add') {
labelStart.innerHTML = 'Start Date';
divBiz.style.display = 'block';
} else if (mode === 'subtract') {
labelStart.innerHTML = 'Target End Date'; // Logic: We subtract FROM this
divBiz.style.display = 'block';
} else if (mode === 'diff') {
labelStart.innerHTML = 'Start Date';
divEnd.style.display = 'block';
divDuration.style.display = 'none';
divBiz.style.display = 'none'; // Difference usually implies calendar days, simplified here
}
// Hide results when mode changes
document.getElementById('dw-result-container').style.display = 'none';
}
function calculateDateWheel() {
var mode = document.getElementById('calcMode').value;
var excludeWeekends = document.getElementById('excludeWeekends').checked;
// Get Inputs
var startDateStr = document.getElementById('startDate').value;
var endDateStr = document.getElementById('endDate').value;
var weeks = parseInt(document.getElementById('weeksInput').value) || 0;
var days = parseInt(document.getElementById('daysInput').value) || 0;
if (!startDateStr) {
alert("Please select a valid date.");
return;
}
// Helper: Parse YYYY-MM-DD to Date object in local time
function parseDate(str) {
var parts = str.split('-');
return new Date(parts[0], parts[1] – 1, parts[2]);
}
// Helper: Add business days
function addBusinessDays(date, daysToAdd) {
var result = new Date(date);
var added = 0;
// Handle negative if needed, but easier to just loop
var direction = daysToAdd >= 0 ? 1 : -1;
daysToAdd = Math.abs(daysToAdd);
while (added < daysToAdd) {
result.setDate(result.getDate() + direction);
var day = result.getDay();
if (day !== 0 && day !== 6) { // 0=Sun, 6=Sat
added++;
}
}
return result;
}
var resultDate;
var resultText = "";
var totalDays = 0;
var resultLabel = "Resulting Date";
// LOGIC
if (mode === 'diff') {
if (!startDateStr || !endDateStr) {
alert("Please select both start and end dates.");
return;
}
var d1 = parseDate(startDateStr);
var d2 = parseDate(endDateStr);
// Calculate difference in time
var timeDiff = d2.getTime() – d1.getTime();
// Calculate difference in days
var dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
// Handle absolute difference or directional? Usually absolute for duration
var isNegative = dayDiff < 0;
dayDiff = Math.abs(dayDiff);
var diffWeeks = Math.floor(dayDiff / 7);
var diffDays = dayDiff % 7;
resultLabel = "Duration";
resultText = diffWeeks + " Weeks, " + diffDays + " Days";
if (isNegative) resultText += " (Negative)";
totalDays = dayDiff; // For meta display
// For difference mode, "Result Date" is N/A, we display duration text
// We need to alter the display slightly
document.getElementById('mainResult').innerHTML = resultText;
document.getElementById('dayOfWeekResult').innerHTML = "N/A";
document.getElementById('totalDaysResult').innerHTML = totalDays + " Days";
document.getElementById('weekNumResult').innerHTML = "N/A";
} else {
// Mode is Add or Subtract
var baseDate = parseDate(startDateStr);
var totalDaysToAdd = (weeks * 7) + days;
if (mode === 'subtract') {
totalDaysToAdd = totalDaysToAdd * -1;
}
if (excludeWeekends) {
// Business Logic
// Note: Weeks input implies 5 business days per week usually?
// Standard Interpretation: "2 weeks" in business days usually means 10 business days.
// However, mixed inputs (Weeks + Days) in biz mode usually converts weeks to days first.
var businessDaysToProcess = (weeks * 5) + days;
if (mode === 'subtract') businessDaysToProcess = businessDaysToProcess * -1;
resultDate = addBusinessDays(baseDate, businessDaysToProcess);
totalDays = Math.abs(businessDaysToProcess) + " (Business Days)";
} else {
// Calendar Logic
resultDate = new Date(baseDate);
resultDate.setDate(baseDate.getDate() + totalDaysToAdd);
totalDays = Math.abs(totalDaysToAdd);
}
// Formatting Output
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
resultText = resultDate.toLocaleDateString('en-US', options);
document.getElementById('mainResult').innerHTML = resultText;
document.getElementById('dayOfWeekResult').innerHTML = resultDate.toLocaleDateString('en-US', { weekday: 'long' });
document.getElementById('totalDaysResult').innerHTML = totalDays;
document.getElementById('weekNumResult').innerHTML = getISOWeek(resultDate);
if (mode === 'subtract') {
document.getElementById('resultLabel').innerText = "Start Date Required";
} else {
document.getElementById('resultLabel').innerText = "Target End Date";
}
}
document.getElementById('dw-result-container').style.display = 'block';
}
// Helper to get ISO Week Number
function getISOWeek(d) {
var date = new Date(d.getTime());
date.setHours(0, 0, 0, 0);
// Thursday in current week decides the year.
date.setDate(date.getDate() + 3 – (date.getDay() + 6) % 7);
var week1 = new Date(date.getFullYear(), 0, 4);
return 1 + Math.round(((date.getTime() – week1.getTime()) / 86400000 – 3 + (week1.getDay() + 6) % 7) / 7);
}