Replace week notation with day.month date format; fix leap year M2-M9 DOY offset and holiday count
This commit is contained in:
+6
-14
@@ -408,11 +408,15 @@ function renderTabs() {
|
|||||||
|
|
||||||
function renderMonth(year, month) {
|
function renderMonth(year, month) {
|
||||||
const leap = isLeapYear(year);
|
const leap = isLeapYear(year);
|
||||||
const monthStart = month * 36 + 1; // doy of Month N Day 0 (N=0..9)
|
// doy of Month N Day 0. In a leap year, months 2-9 start one DOY later
|
||||||
|
// because leap day (DOY 60) sits inside Month 1.
|
||||||
|
const monthStart = month * 36 + 1 + (leap && month >= 2 ? 1 : 0);
|
||||||
|
|
||||||
// Approx gregorian range for subtitle
|
// Approx gregorian range for subtitle
|
||||||
|
// Leap M1 ends at DOY 73 (Mar 13) not 72, because the split cell adds 1
|
||||||
|
const isLeapM1 = leap && month === 1;
|
||||||
const gStart = gregLabel(year, monthStart);
|
const gStart = gregLabel(year, monthStart);
|
||||||
const gEnd = gregLabel(year, monthStart + 35);
|
const gEnd = gregLabel(year, monthStart + 35 + (isLeapM1 ? 1 : 0));
|
||||||
|
|
||||||
navTitle.childNodes[0].textContent = `${year} · Month ${month}`;
|
navTitle.childNodes[0].textContent = `${year} · Month ${month}`;
|
||||||
navSub.textContent = `${gStart} – ${gEnd}`;
|
navSub.textContent = `${gStart} – ${gEnd}`;
|
||||||
@@ -431,7 +435,6 @@ function renderMonth(year, month) {
|
|||||||
|
|
||||||
// In a leap year, M1 W3 D4 is split: top=Feb28(DOY59), bottom=LeapDay(DOY60)
|
// In a leap year, M1 W3 D4 is split: top=Feb28(DOY59), bottom=LeapDay(DOY60)
|
||||||
// All cells from dayInMonth>=23 (W3 D5 onward) get doy+1 to skip over leap day
|
// All cells from dayInMonth>=23 (W3 D5 onward) get doy+1 to skip over leap day
|
||||||
const isLeapM1 = leap && month === 1;
|
|
||||||
|
|
||||||
for (let week = 0; week <= 5; week++) {
|
for (let week = 0; week <= 5; week++) {
|
||||||
for (let wd = 0; wd <= 5; wd++) {
|
for (let wd = 0; wd <= 5; wd++) {
|
||||||
@@ -488,13 +491,8 @@ function renderMonth(year, month) {
|
|||||||
const topGreg = document.createElement("div");
|
const topGreg = document.createElement("div");
|
||||||
topGreg.className = "greg-date";
|
topGreg.className = "greg-date";
|
||||||
topGreg.textContent = `${gregWd} ${gregLabel(year, doy)}`;
|
topGreg.textContent = `${gregWd} ${gregLabel(year, doy)}`;
|
||||||
const topWd = document.createElement("div");
|
|
||||||
topWd.className = "greg-date";
|
|
||||||
topWd.style.color = "#555";
|
|
||||||
topWd.textContent = `W${week} D${wd}`;
|
|
||||||
topHalf.appendChild(topNum);
|
topHalf.appendChild(topNum);
|
||||||
topHalf.appendChild(topGreg);
|
topHalf.appendChild(topGreg);
|
||||||
topHalf.appendChild(topWd);
|
|
||||||
cell.appendChild(topHalf);
|
cell.appendChild(topHalf);
|
||||||
|
|
||||||
// ── Bottom half: Leap Day (Feb 29), its own independent mini-cell ──
|
// ── Bottom half: Leap Day (Feb 29), its own independent mini-cell ──
|
||||||
@@ -540,14 +538,8 @@ function renderMonth(year, month) {
|
|||||||
greg.className = "greg-date";
|
greg.className = "greg-date";
|
||||||
greg.textContent = `${gregWd} ${gregLabel(year, doy)}`;
|
greg.textContent = `${gregWd} ${gregLabel(year, doy)}`;
|
||||||
|
|
||||||
const wdLabel = document.createElement("div");
|
|
||||||
wdLabel.className = "greg-date";
|
|
||||||
wdLabel.style.color = "#555";
|
|
||||||
wdLabel.textContent = `W${week} D${wd}`;
|
|
||||||
|
|
||||||
cell.appendChild(dayNum);
|
cell.appendChild(dayNum);
|
||||||
cell.appendChild(greg);
|
cell.appendChild(greg);
|
||||||
cell.appendChild(wdLabel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Holiday markers — for split cells, attach to topHalf (Feb 28); otherwise to cell
|
// Holiday markers — for split cells, attach to topHalf (Feb 28); otherwise to cell
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
Decimal time was paired with it for the same reason: the standard 24-hour clock is an arbitrary
|
Decimal time was paired with it for the same reason: the standard 24-hour clock is an arbitrary
|
||||||
Babylonian inheritance. Dividing the day into 10 hours of 100 minutes of 100 seconds gives a
|
Babylonian inheritance. Dividing the day into 10 hours of 100 minutes of 100 seconds gives a
|
||||||
fully base-10 time system that is easier to reason about and calculate with.
|
fully base-10 time system that is easier to reason about and calculate with.
|
||||||
All units in the Seth system — months, weeks, days, hours, minutes, seconds — are zero-indexed.
|
All units in the Seth system — months, days, hours, minutes, seconds — are zero-indexed.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Credit is due to the <strong>French Republican Calendar</strong> (1793), which pioneered both ideas:
|
Credit is due to the <strong>French Republican Calendar</strong> (1793), which pioneered both ideas:
|
||||||
@@ -134,27 +134,32 @@
|
|||||||
<div class="seth-note">
|
<div class="seth-note">
|
||||||
<p>
|
<p>
|
||||||
<strong>Seth Date</strong> uses the same year numbers and January 1 new year as the Gregorian
|
<strong>Seth Date</strong> uses the same year numbers and January 1 new year as the Gregorian
|
||||||
calendar. The year is divided into <strong>10 months of 36 days</strong> (6 weeks of 6 days each),
|
calendar. The year is divided into <strong>10 months of 36 days each</strong>,
|
||||||
followed by <strong>5 holiday days</strong> at year end (6 on leap years).
|
followed by <strong>5 holiday days</strong> at year end (6 on leap years).
|
||||||
All units are <strong>zero-indexed</strong>: months 0–9, days 0–35, weeks 0–5, weekdays 0–5.
|
All units are <strong>zero-indexed</strong>: months 0–9, days-of-month 0–35.
|
||||||
Time uses the same decimal system: 10 hours, 100 minutes, 100 seconds per day.
|
Time uses the same decimal system: 10 hours, 100 minutes, 100 seconds per day.
|
||||||
The Seth second is derived from the Unix second (which equals the SI second, leap seconds aside)
|
The Seth second is derived from the Unix second (which equals the SI second, leap seconds aside)
|
||||||
at a fixed ratio: <strong>1 Seth second = 0.864 SI seconds</strong> (86,400 SI seconds per day ÷ 100,000 Seth seconds per day).
|
at a fixed ratio: <strong>1 Seth second = 0.864 SI seconds</strong> (86,400 SI seconds per day ÷ 100,000 Seth seconds per day).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Leap Day</strong> (Gregorian Feb 29) is a special intercalary day that exists
|
<strong>Leap Day</strong> (Gregorian Feb 29) is a special intercalary day that exists
|
||||||
<em>outside</em> the normal month and week structure. It is inserted between Month 1, Week 3, Day 4
|
<em>outside</em> the normal month structure. It is inserted at day-of-year 60, between
|
||||||
and Month 1, Week 3, Day 5 — occupying DOY 60 in its own slot. After Leap Day the calendar
|
day 22 and day 23 of Month 1. After Leap Day the calendar resumes unchanged, which is why
|
||||||
resumes at D5 unchanged, which is why every Seth date from March 1 onward falls on the same
|
every Seth date from March 1 onward falls on the same Gregorian date every year
|
||||||
Gregorian date every year (e.g. Christmas is always Month 9, Day 34). On the calendar it appears
|
(e.g. Christmas is always Month 9, Day 34). On the calendar it appears as a split cell:
|
||||||
as a split cell sharing the D4 column: the top half is the normal D4 day, the bottom half is Leap Day.
|
the top half is day 22, the bottom half is Leap Day.
|
||||||
</p>
|
|
||||||
<p><strong>Reading the date:</strong> dates are written as
|
|
||||||
<em>Year M W D</em> —
|
|
||||||
e.g. <em>Month 3, Week 2, Day 4</em> means the 3rd month (0-indexed), week 2, day 4 of that week,
|
|
||||||
which is day 16 of the month (2×6 + 4).
|
|
||||||
Holiday days are written as <em>Holiday N</em> (N = 0–4, or 0–5 on leap years) and fall outside any month or week.
|
|
||||||
</p>
|
</p>
|
||||||
|
<p><strong>Date notation:</strong> dates are written as <em>day.month</em> (day-of-month first, zero-indexed).</p>
|
||||||
|
<table class="ref-table">
|
||||||
|
<thead><tr><th>Format</th><th>Pattern</th><th>Example (day 16 of month 3, year 2026)</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>Short</td><td>D.M</td><td>16.3</td></tr>
|
||||||
|
<tr><td>Medium</td><td>D.M.YY</td><td>16.3.26</td></tr>
|
||||||
|
<tr><td>Log</td><td>DD.M.YYYY</td><td>16.3.2026</td></tr>
|
||||||
|
<tr><td>Full / reverse</td><td>YYYY.M.DD</td><td>2026.3.16</td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p>Holiday days are written as <em>H0</em>–<em>H4</em> (or <em>H5</em> on leap years).</p>
|
||||||
<p><strong>Months</strong> (months 0–9, days 0–35, approx. Gregorian ranges):</p>
|
<p><strong>Months</strong> (months 0–9, days 0–35, approx. Gregorian ranges):</p>
|
||||||
<table class="ref-table">
|
<table class="ref-table">
|
||||||
<thead><tr><th>#</th><th>Days</th><th>Approx. Gregorian</th><th>Notes</th></tr></thead>
|
<thead><tr><th>#</th><th>Days</th><th>Approx. Gregorian</th><th>Notes</th></tr></thead>
|
||||||
@@ -171,34 +176,21 @@
|
|||||||
<tr><td>9</td><td>0–35</td><td>Nov 21 – Dec 26</td><td>Ends Dec 25 on leap years</td></tr>
|
<tr><td>9</td><td>0–35</td><td>Nov 21 – Dec 26</td><td>Ends Dec 25 on leap years</td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p><strong>Weeks</strong> (weeks 0–5 within each month, days 0–5 within each week):</p>
|
<p><strong>Holiday days</strong> (after Month 9, Day 35 — always exactly 5):</p>
|
||||||
<table class="ref-table">
|
|
||||||
<thead><tr><th>Week</th><th>Days</th></tr></thead>
|
|
||||||
<tbody>
|
|
||||||
<tr><td>0</td><td>0–5</td></tr>
|
|
||||||
<tr><td>1</td><td>6–11</td></tr>
|
|
||||||
<tr><td>2</td><td>12–17</td></tr>
|
|
||||||
<tr><td>3</td><td>18–23</td></tr>
|
|
||||||
<tr><td>4</td><td>24–29</td></tr>
|
|
||||||
<tr><td>5</td><td>30–35</td></tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p><strong>Holiday days</strong> (after Month 9, Day 35):</p>
|
|
||||||
<table class="ref-table">
|
<table class="ref-table">
|
||||||
<thead><tr><th>Holiday</th><th>Normal year</th><th>Leap year</th></tr></thead>
|
<thead><tr><th>Holiday</th><th>Normal year</th><th>Leap year</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>H0</td><td>Dec 27</td><td>Dec 26 — Boxing Day</td></tr>
|
<tr><td>H0</td><td>Dec 27</td><td>Dec 27</td></tr>
|
||||||
<tr><td>H1</td><td>Dec 28</td><td>Dec 27</td></tr>
|
<tr><td>H1</td><td>Dec 28</td><td>Dec 28</td></tr>
|
||||||
<tr><td>H2</td><td>Dec 29</td><td>Dec 28</td></tr>
|
<tr><td>H2</td><td>Dec 29</td><td>Dec 29</td></tr>
|
||||||
<tr><td>H3</td><td>Dec 30</td><td>Dec 29</td></tr>
|
<tr><td>H3</td><td>Dec 30</td><td>Dec 30</td></tr>
|
||||||
<tr><td>H4</td><td>Dec 31 — New Year's Eve</td><td>Dec 30</td></tr>
|
<tr><td>H4</td><td>Dec 31 — New Year's Eve</td><td>Dec 31 — New Year's Eve</td></tr>
|
||||||
<tr><td>H5*</td><td>—</td><td>Dec 31 — New Year's Eve</td></tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p style="font-size:0.8rem;">
|
<p style="font-size:0.8rem;">
|
||||||
* Leap years only.<br>
|
Leap Day (Feb 29) is the intercalary day, not an extra holiday.<br>
|
||||||
Christmas (Dec 25) falls on Month 9, Day 34 in normal years, and Month 9, Day 35 in leap years.<br>
|
Christmas (Dec 25) falls on Month 9, Day 34 in normal years, and Month 9, Day 35 in leap years.<br>
|
||||||
Dec 26 (Boxing Day) is Month 9, Day 35 in normal years, and Holiday 0 in leap years.
|
Dec 26 (Boxing Day) is Month 9, Day 35 in normal years, and Month 9, Day 35 in leap years (same slot, one day earlier Gregorian).
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
@@ -68,13 +68,44 @@ function getDayOfYear(date, zone) {
|
|||||||
return { year, doy };
|
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) {
|
function formatSethDate(sd) {
|
||||||
if (sd.type === "leapday") return "Leap Day";
|
if (sd.type === "leapday") return "Leap Day";
|
||||||
if (sd.type === "holiday") {
|
if (sd.type === "holiday") {
|
||||||
const total = sd.leap ? 6 : 5;
|
const total = sd.leap ? 6 : 5;
|
||||||
return `Holiday ${sd.holiday} of ${total}`;
|
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) {
|
function formatSethLong(sd) {
|
||||||
@@ -88,7 +119,7 @@ function formatSethLong(sd) {
|
|||||||
else if (isBoxingDay) note = " — Boxing Day";
|
else if (isBoxingDay) note = " — Boxing Day";
|
||||||
return `${sd.year} Holiday ${sd.holiday}${note}`;
|
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) ---
|
// --- Decimal time (same as decimal page) ---
|
||||||
|
|||||||
Reference in New Issue
Block a user