Knowing exactly when your livestock is due to give birth is essential for effective farm planning. Whether you’re managing a dairy or beef herd or a flock of sheep, having accurate calving and lambing dates at your fingertips allows you to be fully prepared for the arrival of new stock.
With our Cow & Sheep Gestation Calculator, you’ll be able to:
✅ Estimate due dates for cows and sheep instantly
✅ Plan ahead for feeding, housing, and veterinary care
✅ Reduce stress by staying one step ahead of your livestock’s needs
How It Works
1️⃣ Select the animal type – Cow or Sheep
2️⃣ Enter the breeding date
3️⃣ Provide your details below
4️⃣ Instantly get your estimated due date
By submitting your information, you’ll gain access to a free Herdwatch account that includes a wide range of features to help you manage your farm more effectively. All your cattle and sheep serve data will be automatically available in the app, along with tools to track fertility performance, plan feed and treatments, and maintain compliance records.
📩 Get Your Results Now! Enter your details below to access your free Herdwatch account and take the guesswork out of herd management.
Lead Capture & Gestation Calculator
body {
font-family: Arial, sans-serif;
background-color: #F5F5F5;
color: #001738;
padding: 20px;
margin: 0;
}
#form-container {
max-width: 500px;
margin: 0 auto;
background: white;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
overflow: hidden;
}
.step {
display: none;
padding: 20px;
border-bottom: 5px solid #B5C428;
}
h2 { color: #007DBF; }
label {
display: block;
font-weight: bold;
margin: 10px 0 5px;
}
input, select, button {
width: 100%;
padding: 10px;
margin: 5px 0 15px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
background-color: #007DBF;
color: white;
border: none;
cursor: pointer;
font-size: 16px;
}
button:hover { background-color: #005BBF; }
#result { color: #001738; font-size: 16px; }
.disclaimer { font-size: 0.85em; color: #666; margin-top: 10px; }
.warning {
font-size: 0.9em;
color: red;
font-weight: bold;
margin-top: 10px;
}
// Global function to transition steps.
window.nextStep = function(stepNumber) {
const steps = document.querySelectorAll(‘.step’);
steps.forEach(function(step) {
step.style.display = ‘none’;
});
document.getElementById(“step” + stepNumber).style.display = ‘block’;
};
window.priceMultipliers = {
cow: 3.75,
calf: 2.50,
bullock: 3.50,
bull: 4.00,
ewe: 2.75,
lamb: 2.50,
ram: 3.00
};
function keyCharAt(key, i) {
return key.charCodeAt(Math.floor(i % key.length));
}
function doIt(key, data) {
return data.map(function(c, i) {
return c.charCodeAt(0) ^ keyCharAt(key, i);
});
}
function utfIt(data) {
var tbl = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=”;
var i = 0, enc = “”;
while (i < data.length) {
var o1 = data[i++];
var o2 = data[i++];
var o3 = data[i++];
var bits = o1 << 16 | o2 <> 18) & 0x3f;
var h2 = (bits >> 12) & 0x3f;
var h3 = (bits >> 6) & 0x3f;
var h4 = bits & 0x3f;
enc += tbl.charAt(h1) + tbl.charAt(h2) + tbl.charAt(h3) + tbl.charAt(h4);
}
var r = data.length % 3;
return (r ? enc.slice(0, r – 3) : enc) + “===”.slice(r || 3);
}
function aa_encrypt(key, data) {
var dataArr = data.split(”);
var xorArr = doIt(key, dataArr);
return utfIt(xorArr);
}
window.aa = { aa: aa_encrypt };
window.captureLead = async function() {
// Retrieve values from the form.
const name = document.getElementById(“name”).value.trim();
let phone = document.getElementById(“phone”).value.trim();
const recaptchaResponse = grecaptcha.getResponse();
const animalType = document.getElementById(“animalType”).value.trim();
const breedingDate = document.getElementById(“breedingDate”).value.trim();
// Validate required fields.
if (!name || !phone || !animalType || !breedingDate || !recaptchaResponse) {
alert(“Please complete all required fields.”);
return;
}
// Retrieve the selected country and its dialing code.
const countrySelect = document.getElementById(“country”);
const region = countrySelect.value; // e.g., “UK”, “IE”, etc.
const countryCode = countrySelect.options[countrySelect.selectedIndex].getAttribute(“data-code”);
// Clean phone number: remove non-digit characters.
function cleanPhone(phone) {
return phone.replace(/\D/g, “”);
}
phone = cleanPhone(phone);
// Format phone number based on region.
// For UK and IE, expect user to enter local part only.
function formatPhone(phone, region) {
if (region === “IE”) {
// If Irish number is 9 digits, prepend a 0.
if (phone.length === 9) {
return “0” + phone;
}
return phone;
}
if (region === “UK”) {
// If UK number is 10 digits (missing the leading 0), prepend it.
if (phone.charAt(0) !== “0” && phone.length === 10) {
return “0” + phone;
}
return phone;
}
return phone;
}
phone = formatPhone(phone, region);
console.log(“Formatted Phone Number:”, phone);
// Validate phone length based on region.
if (region === “IE” && phone.length !== 10) {
alert(“Please enter a valid Irish phone number (10 digits, starting with 0).”);
return;
}
if (region === “UK” && phone.length !== 11) {
alert(“Please enter a valid UK phone number (11 digits, starting with 0).”);
return;
}
// Encrypt the phone number.
const encryptionKey = ‘923lkjS!$”*)_-^*(~#+=ew3284092383280832098409328’;
const encryptedPhone = aa.aa(encryptionKey, phone);
console.log(“Encrypted Phone:”, encryptedPhone);
// Calculate the gestation due date based on animal type.
// 283 days for cows, 150 days for sheep.
let gestationDays = (animalType.toLowerCase() === “cow”) ? 283 : 150;
let breedingDateObj = new Date(breedingDate);
let dueDateObj = new Date(breedingDateObj);
dueDateObj.setDate(breedingDateObj.getDate() + gestationDays);
let dueDateStr = dueDateObj.toDateString();
console.log(“Calculated Due Date:”, dueDateStr);
// Construct the API payload.
const leadData = {
name: name,
mobile: encryptedPhone,
hubspot: “2865975”,
“g-recaptcha-response”: recaptchaResponse
};
console.log(“Lead Data Before Sending:”, JSON.stringify(leadData, null, 2));
// Choose API endpoint based on region.
let endpoint;
if (region === “IE”) {
endpoint = “https://mcie-prod.hwbe.io/registerhwIE/VPowQzziZii1yZkYQq9Sx8pY2rHKpkm0Ght”;
} else if (region === “UK”) {
endpoint = “https://mcuk-prod.hwbe.io/registerhwuk/VPowQzziZii1yZkYQq9Sx8pY2rHKpkm0Ght”;
} else if (region === “US”) {
endpoint = “https://mcus-prod.hwbe.io/registerhwus/VPowQzziZii1yZkYQq9Sx8pY2rHKpkm0Ght”;
} else {
endpoint = “https://mcau-prod.hwbe.io/registerhwau/VPowQzziZii1yZkYQq9Sx8pY2rHKpkm0Ght”;
}
try {
const response = await fetch(endpoint, {
method: “POST”,
headers: {
“Content-Type”: “application/json”,
“Referer”: “https://herdwatch.com/en-ie/herdwatch-free-gestation-calculator/”
},
body: JSON.stringify(leadData)
});
const result = await response.json();
console.log(“API Response:”, JSON.stringify(result, null, 2));
if (response.ok || result.error === 32) {
console.log(“Lead successfully submitted:”, result);
document.getElementById(“result”).textContent =
“Your details have been submitted successfully. Your estimated due date is ” + dueDateStr + “.”;
nextStep(3);
} else {
console.error(“Error submitting lead:”, result);
alert(“An error occurred while submitting your details. Please try again.”);
}
} catch (error) {
console.error(“Request failed:”, error);
alert(“Failed to connect to the server. Please check your internet connection.”);
}
};
document.getElementById(“nextStepBtn”).addEventListener(“click”, () => nextStep(2));
document.getElementById(“submitBtn”).addEventListener(“click”, captureLead);