feat: Add Saturday localization support in settings and update calendar type handling

This commit is contained in:
Mo Tarbin
2026-03-08 21:59:42 -04:00
parent e5504e0bdf
commit 0a0a5bd60f
6 changed files with 20 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import Calendar from 'react-calendar'
import { useNavigate } from 'react-router-dom'
import { useCircleMembers, useUserProfile } from '../../queries/UserQueries'
import { getPriorityColor, TASK_COLOR } from '../../utils/Colors'
import { useLocalization } from '../../contexts/LocalizationContext'
import styles from './CalendarDual.module.css'
const getAssigneeColor = (assignee, userProfile) => {
@@ -13,6 +14,9 @@ const getAssigneeColor = (assignee, userProfile) => {
}
const CalendarDual = ({ chores, onDateChange }) => {
const { data: userProfile } = useUserProfile()
const { firstDayOfWeek } = useLocalization()
const calendarType =
firstDayOfWeek === 1 ? 'iso8601' : firstDayOfWeek === 6 ? 'islamic' : 'gregory'
const [selectedDate, setSeletedDate] = useState(null)
const [currentDate, setCurrentDate] = useState(new Date())
@@ -106,6 +110,7 @@ const CalendarDual = ({ chores, onDateChange }) => {
<Calendar
className={styles.reactCalendar}
tileContent={tileContent}
calendarType={calendarType}
onChange={d => {
let date = new Date(d)
setSeletedDate(date)