Where does it come from?

Where does it come from?

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

    document.addEventListener("DOMContentLoaded", function () { /* -------- Date Helpers -------- */ function addDays(date, days) { const d = new Date(date); d.setDate(d.getDate() + days); return d; } function isWorkingDay(date) { const day = date.getDay(); // 0=Sun, 6=Sat return day !== 0 && day !== 6; // Mon-Fri only } function addWorkingDays(startDate, days) { let current = new Date(startDate); let remaining = days; while (remaining > 0) { current = addDays(current, 1); if (isWorkingDay(current)) { remaining--; } } return current; } function formatDate(date) { return date.toISOString().split('T')[0]; // YYYY-MM-DD } /* -------- DOM Wiring -------- */ const calcButton = document.getElementById("calcBtn"); const daysInput = document.getElementById("daysInput"); const typeContainer = document.getElementById("typeContainer"); const dayTypeSelect = document.getElementById("dayType"); const resultDiv = document.getElementById("result"); if (!calcButton || !daysInput || !typeContainer || !dayTypeSelect || !resultDiv) { console.error("Required DOM elements missing"); return; } let enteredDays = 0; calcButton.addEventListener("click", function () { enteredDays = parseInt(daysInput.value, 10); if (!Number.isInteger(enteredDays) || enteredDays < 0) { resultDiv.textContent = "Please enter a valid non-negative integer."; resultDiv.style.color = "red"; return; } typeContainer.style.display = "block"; dayTypeSelect.value = ""; resultDiv.textContent = ""; }); dayTypeSelect.addEventListener("change", function () { if (enteredDays === 0) return; const today = new Date(); let resultDate; if (dayTypeSelect.value === "working") { resultDate = addWorkingDays(today, enteredDays); } else { resultDate = addDays(today, enteredDays); } const formatted = formatDate(resultDate); resultDiv.textContent = `Result date: ${formatted}`; resultDiv.style.color = "green"; // Reset enteredDays = 0; typeContainer.style.display = "none"; dayTypeSelect.value = ""; daysInput.value = ""; }); });