-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(datepicker): update docs and add examples #7837
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
src/lib/datepicker/datepicker.md
Outdated
### Setting the selected date | ||
|
||
The type of values that the datepicker expects actually depends on the particular `DateAdapter` that | ||
you're using in your app. For example when using the `NativeDateAdapter` the datepicker expects |
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.
For example -> For example,
src/lib/datepicker/datepicker.md
Outdated
you're using in your app. For example when using the `NativeDateAdapter` the datepicker expects | ||
`Date` objects, and when using the `MomentDateAdapter` it expects `Moment` objects. You can also | ||
create your own `DateAdapter` that works with whatever date type you want. (For more information | ||
about this see the section on |
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.
about this -> about this,
src/lib/datepicker/datepicker.md
Outdated
### Disabling parts of the datepicker | ||
|
||
As with any standard `<input>`, it is possible to disable the datepicker input by adding the | ||
`disabled` property. By default the `<mat-datepicker>` and `<mat-datepicker-toggle>` will inherit |
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.
By default -> By default,
src/lib/datepicker/datepicker.md
Outdated
formats. | ||
|
||
If you want use one of the `DateAdapters` that ships with Angular Material, but use your own | ||
`MAT_DATE_FORMATS` you can import the `NativeDateModule` or `MomentDateModule`. These modules are |
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.
MAT_DATE_FORMATS
you can -> MAT_DATE_FORMATS
, you can
disabled: FormGroup; | ||
|
||
constructor(fb: FormBuilder) { | ||
this.disabled = fb.group({ |
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.
Are you using this FormGroup
anywhere?
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.
Oh nope, I was originally gonna do something else for this example and that was leftover
templateUrl: 'datepicker-locale-example.html', | ||
styleUrls: ['datepicker-locale-example.css'], | ||
providers: [ | ||
// The locale would typically be provided on the root module of your application, we do it at |
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.
application, we do -> application. We do
comments addressed |
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
e2e app is broken, probably some moment / material-date-adapter issue, will look into it |
tests are good now (well as good as master...) |
fixes #7464 |
src/lib/datepicker/datepicker.md
Outdated
containing the `startAt` date. | ||
|
||
<!-- example(datepicker-start-view) --> | ||
|
||
### Setting the selected date | ||
|
||
The type of values that the datepicker expects actually depends on the particular `DateAdapter` that |
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.
The type of values that the datepicker expects depends on the type of `DateAdapter` provided in your
application. The `NativeDateAdapter`, for example, works directly with plain JavaScript `Date` objects.
When using the `MomentDateAdapter`, however, the values will all be Moment.js instances. This use of the
adapter pattern allows the datepicker component to work with any arbitrary date representation with a custom `DateAdapter`.
See [_Choosing a date implementation_](#choosing-a-date-implementation-and-date-format-settings) for more information.
src/lib/datepicker/datepicker.md
Outdated
about this, see the section on | ||
[choosing a date implementation](#choosing-a-date-implementation-and-date-format-settings)). | ||
|
||
Depending on the `DateAdapter` you're using, the datepicker may automatically deserialize certain |
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.
"Depending on the DateAdapter
you're using" -> "Depending on the DateAdapter
being used"
src/lib/datepicker/datepicker.md
Outdated
date formats for you as well. For example, both the `NativeDateAdapter` and `MomentDateAdapter` | ||
allow [ISO 8601](https://tools.ietf.org/html/rfc3339) strings to be passed to the datepicker and | ||
automatically converted to the proper object type. This can be convenient when binding data directly | ||
from your backend to the datepicker. However, when possible, you should pass the appropriate object |
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.
However, when possible, you should pass the appropriate object type.
If we officially support it should we need to recommend against it?
src/lib/datepicker/datepicker.md
Outdated
|
||
The input's native `(input)` and `(change)` events will only trigger due to user interaction with | ||
the input element; they will not fire when the user selects a date from the calendar popup. Because | ||
of this limitation, the datepicker input also has support for `(dateInput)` and `(dateChange)` |
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 wouldn't use the word "limitation", since that's the expected native behavior.
src/lib/datepicker/datepicker.md
Outdated
|
||
<!-- example(datepicker-api) --> | ||
|
||
### Internationalization | ||
|
||
In order to support internationalization, the datepicker supports customization of the following |
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.
While you're here, change this to
"Internationalization of the datepicker is configured via three aspects:"
?
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.
Also, it's odd that the headers directly under this list don't align with the points here.
src/lib/datepicker/datepicker.md
Outdated
* Support for custom time zones | ||
* Infinite scrolling through calendar months | ||
* Easier year selection | ||
* Custom views for the calendar popup |
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 would omit the future work section here; we don't include it in any of the other docs. Do we have issues to track these?
comments addressed |
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. |
No description provided.