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

feat(Datepicker): Datepicker yearsPerPage value #22253

Closed
nerd-cs opened this issue Mar 17, 2021 · 3 comments
Closed

feat(Datepicker): Datepicker yearsPerPage value #22253

nerd-cs opened this issue Mar 17, 2021 · 3 comments
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team

Comments

@nerd-cs
Copy link

nerd-cs commented Mar 17, 2021

Feature Description

Angular Material Datepicker Multi year view has 24 years in the table.
image

export const yearsPerPage = 24;

Use Case

We can set date range dynamically using MAT_DATE_RANGE_SELECTION_STRATEGY

/** Injection token used to customize the date range selection behavior. */
export const MAT_DATE_RANGE_SELECTION_STRATEGY =
new InjectionToken<MatDateRangeSelectionStrategy>('MAT_DATE_RANGE_SELECTION_STRATEGY');

Hopefully want to set the yearsPerPage dynamically as well.
<mat-datepicker #picker [yearsPerPage]="N">

@nerd-cs nerd-cs added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Mar 17, 2021
@jelbourn
Copy link
Member

I don't think this is something we would introduce an API for

@nerd-cs
Copy link
Author

nerd-cs commented Mar 23, 2021

@jelbourn
If I want to show only 12 years in the Multi year view (2016-2027), what is the solution?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

2 participants