diff --git a/packages/components/calendar/src/calendar-base.tsx b/packages/components/calendar/src/calendar-base.tsx index d202ebf461..c38d57833e 100644 --- a/packages/components/calendar/src/calendar-base.tsx +++ b/packages/components/calendar/src/calendar-base.tsx @@ -9,6 +9,7 @@ import {Button} from "@nextui-org/button"; import {chain, mergeProps} from "@react-aria/utils"; import {AnimatePresence, LazyMotion, MotionConfig} from "framer-motion"; import {ResizablePanel} from "@nextui-org/framer-utils"; +import {useLocale} from "@react-aria/i18n"; import {ChevronLeftIcon} from "./chevron-left"; import {ChevronRightIcon} from "./chevron-right"; @@ -55,11 +56,15 @@ export function CalendarBase(props: CalendarBaseProps) { const [direction, setDirection] = useState(0); + const {direction: localeDirection} = useLocale(); + const currentMonth = state.visibleRange.start; const headers: React.ReactNode[] = []; const calendars: React.ReactNode[] = []; + const isLTR = localeDirection === "ltr"; + for (let i = 0; i < visibleMonths; i++) { let d = currentMonth.add({months: i}); @@ -67,8 +72,13 @@ export function CalendarBase(props: CalendarBaseProps) { {i === 0 && ( @@ -81,8 +91,13 @@ export function CalendarBase(props: CalendarBaseProps) { /> {i === visibleMonths - 1 && (