mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-27 03:34:11 -04:00
jcal: fix firstWeekday calculation
This commit is contained in:
parent
a8d230f478
commit
7c302fa44e
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue