jcal: fix firstWeekday calculation

This commit is contained in:
Quantum 2025-07-01 03:51:07 -04:00
parent a8d230f478
commit 7c302fa44e

View file

@ -54,7 +54,7 @@ function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JS
function Month({year, month, todayJDN}: MonthProps & { todayJDN: number }): JSX.Element { function Month({year, month, todayJDN}: MonthProps & { todayJDN: number }): JSX.Element {
const decadeHeads = weekdayNames.map((name, i) => <WeekdayName key={i} name={name}/>); const decadeHeads = weekdayNames.map((name, i) => <WeekdayName key={i} name={name}/>);
const firstJDN = julianJDN(year, month, 1); const firstJDN = julianJDN(year, month, 1);
const firstWeekday = (firstJDN % 8 + 8) % 7; const firstWeekday = (firstJDN % 7 + 8) % 7;
const daysTotal = julianMonthDays(year, month); const daysTotal = julianMonthDays(year, month);
return <div className="Month"> return <div className="Month">
<div className="Month-weekdayHead">{decadeHeads}</div> <div className="Month-weekdayHead">{decadeHeads}</div>