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

Selected date styling #388

Closed
jantrubka opened this issue Jul 1, 2024 · 3 comments
Closed

Selected date styling #388

jantrubka opened this issue Jul 1, 2024 · 3 comments

Comments

@jantrubka
Copy link

Would it be possible for a selected day style to check whether it is also a custom date or today and merge those styles. It is applicable when for example selected day has a border and should keep a background color of today or custom date

@jantrubka
Copy link
Author

jantrubka commented Jul 1, 2024

I am new to github so don't know how to edit this repo but what I have written can be achieved by editing line 162 in Day.js to computedSelectedDayStyle = [
isToday && styles.selectedToday,
custom.style,
styles.selectedDay,
];

@peacechen
Copy link
Collaborator

Hello @jantrubka . Thanks for identifying the code change. To contribute to this project, fork the repo, commit your changes, and create a Pull Request.

Modifying the styles behavior could be break users who expect the existing behavior. A new prop would be needed to control whether to merge custom styles to Today. For example, mergeCustomStyleSelectedToday.
That may not be necessary at all though. Could you manually merge the styles into selectedDayStyle?

@jantrubka
Copy link
Author

If you mean manually merging the styles in my App, that would be quite difficult for me since the style may be different for each date and it may be changed by the user in a way.
However I believe that my proposal would not disrupt anyone's code because the styles.selectedDay style is still the main one and overwrites the other two. Correct me if I am wrong ;)

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