diff --git a/components/pages/calendar/CalendarHeader.tsx b/components/pages/calendar/CalendarHeader.tsx index e97f064..fb902c8 100644 --- a/components/pages/calendar/CalendarHeader.tsx +++ b/components/pages/calendar/CalendarHeader.tsx @@ -1,10 +1,11 @@ import React, {memo} from 'react'; -import {Picker, PickerModes, SegmentedControl, Text, View} from "react-native-ui-lib"; +import {Button, Picker, PickerModes, SegmentedControl, Text, View} from "react-native-ui-lib"; import {MaterialIcons} from "@expo/vector-icons"; import {modeMap, months} from './constants'; import {StyleSheet} from "react-native"; import {useAtom} from "jotai"; import {modeAtom, selectedDateAtom} from "@/components/pages/calendar/atoms"; +import {isSameDay} from "date-fns"; export const CalendarHeader = memo(() => { const [selectedDate, setSelectedDate] = useAtom(selectedDateAtom); @@ -28,6 +29,8 @@ export const CalendarHeader = memo(() => { setSelectedDate(updatedDate); }; + const isSelectedDateToday = isSameDay(selectedDate, new Date()) + return ( { - - + + {!isSelectedDateToday && ( +