stephy / CalendarPicker

CalendarPicker Component for React Native
802 stars 373 forks source link

How to change todayTextStyle if selectedDayColor is same? #333

Open ireneeming opened 1 year ago

ireneeming commented 1 year ago

Here's my example

스크린샷 2023-01-10 오후 5 46 04

todayTextStyle is red, and when I select a day, the background color also red. so, if I select today, both are red, so I can't see today's date. so, I'm trying to change it to text white and red background.

here's my question. How can I change selected today date color?

alarm109 commented 4 months ago

I check if the date is today and then adjust color appropriately.

import { isToday } from 'date-fns';

const isTodaySelected = isToday(date);
todayTextStyle={{ color: isTodaySelected ? 'black' : 'red' }}