Replace week notation with day.month date format; fix leap year M2-M9 DOY offset and holiday count

This commit is contained in:
2026-03-08 23:51:26 +00:00
parent a6b3f039d8
commit 9bd245d870
3 changed files with 66 additions and 51 deletions
+33 -2
View File
@@ -68,13 +68,44 @@ function getDayOfYear(date, zone) {
return { year, doy };
}
// Notation helpers
// short: D.M e.g. "30.1"
// medium: D.M.YY e.g. "30.1.26"
// log: DD.M.YYYY e.g. "30.1.2026" (DD zero-pads to 2 digits)
// full: YYYY.M.DD e.g. "2026.1.30"
function sethShort(sd) {
if (sd.type === "leapday") return "Leap Day";
if (sd.type === "holiday") return `H${sd.holiday}`;
return `${sd.day}.${sd.month}`;
}
function sethMedium(sd) {
if (sd.type === "leapday") return "Leap Day";
if (sd.type === "holiday") return `H${sd.holiday}.${String(sd.year).slice(-2)}`;
return `${sd.day}.${sd.month}.${String(sd.year).slice(-2)}`;
}
function sethLog(sd) {
if (sd.type === "leapday") return `Leap Day ${sd.year}`;
if (sd.type === "holiday") return `H${sd.holiday}.${sd.year}`;
return `${String(sd.day).padStart(2,"0")}.${sd.month}.${sd.year}`;
}
function sethFull(sd) {
if (sd.type === "leapday") return `${sd.year}.Leap`;
if (sd.type === "holiday") return `${sd.year}.H${sd.holiday}`;
return `${sd.year}.${sd.month}.${sd.day}`;
}
// Legacy display helpers (used by seth.html dateLine)
function formatSethDate(sd) {
if (sd.type === "leapday") return "Leap Day";
if (sd.type === "holiday") {
const total = sd.leap ? 6 : 5;
return `Holiday ${sd.holiday} of ${total}`;
}
return `Month ${sd.month}, Week ${sd.week}, Day ${sd.weekDay}`;
return `${sd.day}.${sd.month} (Month ${sd.month}, Day ${sd.day})`;
}
function formatSethLong(sd) {
@@ -88,7 +119,7 @@ function formatSethLong(sd) {
else if (isBoxingDay) note = " — Boxing Day";
return `${sd.year} Holiday ${sd.holiday}${note}`;
}
return `${sd.year} M${sd.month} W${sd.week} D${sd.weekDay} (Month ${sd.month}, Day ${sd.day})`;
return `${sethLog(sd)} (${sd.year}.${sd.month}.${sd.day})`;
}
// --- Decimal time (same as decimal page) ---