fix(ui): correct calendar header month parsing (#5532)
Co-authored-by: Local Admin <root@localhost>
This commit is contained in:
parent
e1888153f8
commit
2f7c8dcea7
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
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";
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue