fix bad setstate call

This commit is contained in:
shamoon 2023-09-27 21:26:10 -07:00
parent 79958e6986
commit f4fbd2b69a

View File

@ -1,4 +1,4 @@
import { useContext, useMemo } from "react";
import { useContext, useEffect, useMemo } from "react";
import { DateTime, Info } from "luxon";
import classNames from "classnames";
import { useTranslation } from "next-i18next";
@ -95,9 +95,11 @@ export default function MonthlyView({ service }) {
const { events } = useContext(EventContext);
const currentDate = DateTime.now().setLocale(i18n.language).startOf("day");
if (!showDate) {
setShowDate(currentDate);
}
useEffect(() => {
if (!showDate) {
setShowDate(currentDate);
}
})
const dayNames = Info.weekdays("short", { locale: i18n.language });