From 36b4d69c2d60e0574bc7d46b171351bb1a21e0a4 Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Fri, 9 Jan 2026 11:22:03 +0500 Subject: [PATCH] mobile: week format settings --- .../mobile/app/screens/add-reminder/index.tsx | 71 ++++++++++--------- .../app/screens/settings/components.tsx | 2 + .../app/screens/settings/picker/pickers.jsx | 24 +++++++ .../app/screens/settings/settings-data.tsx | 9 +++ apps/mobile/app/stores/use-setting-store.ts | 9 ++- 5 files changed, 79 insertions(+), 36 deletions(-) diff --git a/apps/mobile/app/screens/add-reminder/index.tsx b/apps/mobile/app/screens/add-reminder/index.tsx index c6a1a4413..79289f996 100644 --- a/apps/mobile/app/screens/add-reminder/index.tsx +++ b/apps/mobile/app/screens/add-reminder/index.tsx @@ -42,9 +42,9 @@ import { DDS } from "../../services/device-detection"; import { ToastManager } from "../../services/event-manager"; import Navigation, { NavigationProps } from "../../services/navigation"; import Notifications from "../../services/notifications"; -import PremiumService from "../../services/premium"; import SettingsService from "../../services/settings"; import { useRelationStore } from "../../stores/use-relation-store"; +import { useSettingStore } from "../../stores/use-setting-store"; import { AppFontSize, defaultBorderRadius } from "../../utils/size"; import { DefaultAppStyles } from "../../utils/styles"; import { getFormattedDate, useIsFeatureAvailable } from "@notesnook/common"; @@ -70,7 +70,8 @@ const RecurringModes = { Year: "year" }; -const WeekDays = new Array(7).fill(true); +const WeekDays = [0, 1, 2, 3, 4, 5, 6]; +const WeekDaysMon = [1, 2, 3, 4, 5, 6, 0]; const MonthDays = new Array(31).fill(true); const WeekDayNames = { 0: "Sunday", @@ -92,6 +93,7 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) { const { reminder, reference } = props.route.params; useNavigationFocus(props.navigation, { focusOnInit: true }); const { colors, isDark } = useThemeColors(); + const weekFormat = useSettingStore((state) => state.weekFormat); const [reminderMode, setReminderMode] = useState( reminder?.mode || "once" ); @@ -151,7 +153,7 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) { const isSecondLast = index === selectedDays.length - 2; const joinWith = isSecondLast ? " & " : isLast ? "" : ", "; return recurringMode === RecurringModes.Week - ? WeekDayNames[day as keyof typeof WeekDayNames] + joinWith + ? strings.weekDayNames[day as keyof typeof WeekDayNames]() + joinWith : `${day}${nth(day)} ${joinWith}`; }) .join(""); @@ -390,37 +392,39 @@ export default function AddReminder(props: NavigationProps<"AddReminder">) { recurringMode === RecurringModes.Year ? null : recurringMode === RecurringModes.Week - ? WeekDays.map((item, index) => ( -