-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat(datetime): add ability to specify custom colors for specific dates #26775
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
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small recommended changes, but this feature looks great testing locally. Nice work!
Docs PR created: ionic-team/ionic-docs#2769 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
Just looked at the new release. It is amazing! Thanks for adding this so quickly. |
its docs: https://ionicframework.com/docs/api/datetime#highlighting-specific-dates it seems that it has only two properties "textColor" and "backgroundColor".
is it possible to attach text? so that i could do : |
@averyjohnston @seatechdev @creatxrgithub @sean-perkins @liamdebeasi
|
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Developers have no way of highlighting specific days on the calendar picker with custom styles.
Issue URL: Resolves #25832
What is the new behavior?
Adds a new property,
highlightedDates
, which allows certain dates in the calendar view to be styled with custom text and/or background colors. This can be in the form of either an array of specific dates and their colors, or a callback that takes an ISO string and returns the colors to use.As a side effect, all styles around focused/selected/"today" dates have been consolidated into the new
.calendar-day-highlight
element. A new element was necessary in order to programmatically apply background colors, since inline styles can't be used with pseudo-elements.Note that this feature does not include the ability to show details about events associated with highlighted dates, such as birthdays or scheduled meetings. This is intentional as
ion-datetime
is only intended to concern itself with date selection, and any additional context should be an application-level detail provided in a separate UI.Playgrounds/docs updates are made in a separate PR: ionic-team/ionic-docs#2769
Does this introduce a breaking change?
Other information