-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(datepicker): @Output for year and month selected in multiyear/year #9678
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
Changes from 7 commits
819eae7
4265d17
e9065e9
7ebaa3c
4396b6d
8d10f24
8a1fffa
eaa5c31
7d2bbdc
dc400b3
ed1829c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mat-calendar { | ||
width: 300px; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,23 @@ year containing the `startAt` date. | |
|
||
<!-- example(datepicker-start-view) --> | ||
|
||
#### Watching the views for changes on selected years and months | ||
|
||
When a year or a month is selected in **multi-year and year views** respecively, the `yearSelected` | ||
and `monthSelected` outputs emit the chosen year (full year) and month (0 - 11). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now that I think about this some more, wouldn't it make sense to emit normalized dates There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I'm gonna update this and push it tonight. |
||
|
||
Notice that the emitted value does not affect the current value in the connected `<input>`, which | ||
is only bound to the selection made in the `month` view. So if the end user closes the calendar | ||
after choosing a year in `multi-view` mode (by pressing the `ESC` key, for example) , the selected | ||
year, emitted by `yearSelected` output, will not reflect any change in the value of the date in the | ||
associated `<input>`. | ||
|
||
The following example uses `yearSelected` and `monthSelected` outputs to emulate a month and year | ||
picker (if you're not familiar with the usage of `MomentDateAdapter` and `formats customization` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
you can read more about them below in this document to fully understand the example). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. link the words "read more about them" to the correct header in this document. |
||
|
||
<!-- example(datepicker-views-selection) --> | ||
|
||
### Setting the selected date | ||
|
||
The type of values that the datepicker expects depends on the type of `DateAdapter` provided in your | ||
|
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.
...in the
multi-year
andyear
views...