From e7b69b7d6f0ebb3c578b9f58bcddf8ad36e6c6ce Mon Sep 17 00:00:00 2001
From: Malik-Jouda <48517781+Malik-Jouda@users.noreply.github.com>
Date: Tue, 26 Nov 2024 14:17:06 +0200
Subject: [PATCH] fix(Calendar): handle icons in RTL mode (#2770)
---
src/runtime/components/Calendar.vue | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/runtime/components/Calendar.vue b/src/runtime/components/Calendar.vue
index d89cf0b7..f4cb0a75 100644
--- a/src/runtime/components/Calendar.vue
+++ b/src/runtime/components/Calendar.vue
@@ -71,6 +71,11 @@ const { code: locale, dir, t } = useLocale()
const rootProps = useForwardPropsEmits(reactiveOmit(props, 'range', 'modelValue', 'defaultValue', 'color', 'size', 'monthControls', 'yearControls', 'class', 'ui'), emits)
+const prevYearIcon = computed(() => dir.value === 'rtl' ? appConfig.ui.icons.chevronDoubleRight : appConfig.ui.icons.chevronDoubleLeft)
+const prevMonthIcon = computed(() => dir.value === 'rtl' ? appConfig.ui.icons.chevronRight : appConfig.ui.icons.chevronLeft)
+const nextYearIcon = computed(() => dir.value === 'rtl' ? appConfig.ui.icons.chevronDoubleLeft : appConfig.ui.icons.chevronDoubleRight)
+const nextMonthIcon = computed(() => dir.value === 'rtl' ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight)
+
const ui = computed(() => calendar({
color: props.color,
size: props.size
@@ -99,10 +104,10 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar)
>