diff --git a/jcal/src/Calendar.tsx b/jcal/src/Calendar.tsx index 96931db..9b820ec 100644 --- a/jcal/src/Calendar.tsx +++ b/jcal/src/Calendar.tsx @@ -1,6 +1,6 @@ import React from 'react'; import './Calendar.scss'; -import {formatJG, jdnGregorian, JulianDay, JulianMonth, monthName, weekdayNames} from '@common/gregorian'; +import {formatJG, jdnGregorian, JulianDay, JulianMonth, monthName, jdnWeekDay, weekdayNames} from '@common/gregorian'; import {jdnLongCount} from '@common/longCount'; import {jdnJulian, julianJDN, julianMonthDays} from '@common/julian'; import {frDateFormat, frEndJD, frStartJD, jdnFrench} from '@common/french'; @@ -46,7 +46,7 @@ function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JS const jdn = julianJDN(year, month, day); return
{day}
-
{weekdayNames[(jdn + 1) % 7]}
+
{weekdayNames[jdnWeekDay(jdn)]}
; } @@ -54,7 +54,7 @@ function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JS function Month({year, month, todayJDN}: MonthProps & { todayJDN: number }): JSX.Element { const decadeHeads = weekdayNames.map((name, i) => ); const firstJDN = julianJDN(year, month, 1); - const firstWeekday = (firstJDN % 7 + 8) % 7; + const firstWeekday = jdnWeekDay(firstJDN); const daysTotal = julianMonthDays(year, month); return
{decadeHeads}