feat: Add Saturday localization support in settings and update calendar type handling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user