-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(datepicker): support dateClass on year and multi-year views #20256
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
fix(datepicker): support dateClass on year and multi-year views #20256
Conversation
export type MatCalendarCellCssClasses = string | string[] | Set<string> | {[key: string]: any}; | ||
|
||
/** Function that can generate the extra classes that should be added to a calendar cell. */ | ||
export type MatCalendarCellClassFunction<D> = | ||
(date: D, view: 'month' | 'year' | 'multi-year') => MatCalendarCellCssClasses; |
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.
Do we have a type alias for 'month' | 'year' | 'multi-year'
somewhere? I thought we did, but I could be crazy
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.
I think we've just been doing it inline.
I'm re-classifying this as |
We have a `dateClass` input that allows consumers to set classes to particular date cells, however currently we only invoke it inside the month view. These changes pass it along to the year and multi-year views too and provide the name of the view that invoked it so that cases like the first date of a month and a month cell can be distinguished. Fixes angular#20017.
7870e38
to
d7a9ab6
Compare
I've reworked it based on the feedback. |
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.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We have a
dateClass
input that allows consumers to set classes to particular date cells, however currently we only invoke it inside the month view. These changes pass it along to the year and multi-year views too and provide the name of the view that invoked it so that cases like the first date of a month and a month cell can be distinguished.Fixes #20017.