mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-27 03:34:11 -04:00
gcal: fix missing first week on negative JDN months
This commit is contained in:
parent
59fe324126
commit
88bf611c90
|
@ -68,7 +68,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 = gregorianJDN(year, month, 1);
|
const firstJDN = gregorianJDN(year, month, 1);
|
||||||
const firstWeekday = (firstJDN + 1) % 7;
|
const firstWeekday = (firstJDN % 7 + 8) % 7;
|
||||||
const daysTotal = gregorianMonthDays(year, month);
|
const daysTotal = gregorianMonthDays(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