Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can the day stay highlighted when selected or called by the API? #374

Open
lotusms opened this issue Apr 11, 2024 · 2 comments
Open

Comments

@lotusms
Copy link

lotusms commented Apr 11, 2024

It allows me to select and date and I am sucessfully catching and saving it to DB, as well as displaying in various places. But I dont have a prop in the component to also display it there. When I click on a day, it colors as instructed. Then I move away from the page and come back and although it successfully captured my date, it is unselected from the calendar's UI

<CalendarPicker 
      style={{backgroundColor: activeColors.primary}}
      minDate={minDate}
      width={width * .83}
      todayBackgroundColor={activeColors.black}
      todayTextStyle={{
            color: activeColors.white, 
      }}  
      selectedDayColor={activeColors.primary}
      selectedDayTextColor={activeColors.white}
      textStyle={{
            color: activeColors.textcolor, 
      }}          
      selectedDate={selectedDate || user.selectedDate} // Ideally, this would be great. But there is no such prop
      onDateChange={setSelectedDate}
/>

2024-04-10_21-38-48

@peacechen
Copy link
Collaborator

Try selectedStartDate. That's used for a single date, and if date range is enabled, in conjunction with selectedEndDate

@lotusms
Copy link
Author

lotusms commented Apr 11, 2024

selectedStartDate

That did it! The UX guy inside me tells me that there should be selectedDate for single day selections, since selectedStartDate implies a range and this wasn't the case. Or perhaps mentioned in the docs that this acts as a day selection for single days as well. But thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants