Unverified Commit 2f7c8dce authored by Brent Bilis's avatar Brent Bilis Committed by GitHub

fix(ui): correct calendar header month parsing (#5532)

Co-authored-by: 's avatarLocal Admin <root@localhost>
parent e1888153
import dayjs from "dayjs";
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react"; import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import { YearCalendar } from "@/components/ActivityCalendar"; import { YearCalendar } from "@/components/ActivityCalendar";
...@@ -8,7 +9,7 @@ import type { MonthNavigatorProps } from "@/types/statistics"; ...@@ -8,7 +9,7 @@ import type { MonthNavigatorProps } from "@/types/statistics";
export const MonthNavigator = ({ visibleMonth, onMonthChange, activityStats }: MonthNavigatorProps) => { export const MonthNavigator = ({ visibleMonth, onMonthChange, activityStats }: MonthNavigatorProps) => {
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const currentMonth = new Date(visibleMonth); const currentMonth = dayjs(visibleMonth).toDate();
const currentYear = getYearFromDate(visibleMonth); const currentYear = getYearFromDate(visibleMonth);
const currentMonthNum = getMonthFromDate(visibleMonth); const currentMonthNum = getMonthFromDate(visibleMonth);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment