Skip to content

Commit 6d5f27a

Browse files
committed
docs(datepicker): convert date module tables to be mobile-friendly
- remove instances of "just" Fixes angular/material.angular.io#686
1 parent 581d1f2 commit 6d5f27a

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

src/material/datepicker/datepicker.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,34 @@ It's also possible to set the locale at runtime using the `setLocale` method of
210210
The datepicker was built to be date implementation agnostic. This means that it can be made to work
211211
with a variety of different date implementations. However it also means that developers need to make
212212
sure to provide the appropriate pieces for the datepicker to work with their chosen implementation.
213-
The easiest way to ensure this is just to import one of the pre-made modules:
214213

215-
|Module |Date type|Supported locales |Dependencies |Import from |
216-
|---------------------|---------|-----------------------------------------------------------------------|----------------------------------|----------------------------------|
217-
|`MatNativeDateModule`|`Date` |en-US |None |`@angular/material` |
218-
|`MatMomentDateModule`|`Moment` |[See project](https://github.com/moment/moment/tree/develop/src/locale)|[Moment.js](https://momentjs.com/)|`@angular/material-moment-adapter`|
214+
The easiest way to ensure this is to import one of the provided date modules:
219215

220-
*Please note: `MatNativeDateModule` is based off of the functionality available in JavaScript's
221-
native `Date` object, and is thus not suitable for many locales. One of the biggest shortcomings of
222-
the native `Date` object is the inability to set the parse format. We highly recommend using the
223-
`MomentDateAdapter` or a custom `DateAdapter` that works with the formatting/parsing library of your
224-
choice.*
216+
`MatNativeDateModule`
225217

226-
These modules include providers for `DateAdapter` and `MAT_DATE_FORMATS`
218+
| | |
219+
|---------------------|------------------------|
220+
|Date type |`Date` |
221+
|Supported locales |en-US |
222+
|Dependencies |None |
223+
|Import from |`@angular/material/core`|
224+
225+
`MatMomentDateModule`
226+
227+
| | |
228+
|---------------------|----------------------------------|
229+
|Date type |`Moment` |
230+
|Supported locales |[See project](https://github.com/moment/moment/tree/develop/src/locale) for details|
231+
|Dependencies |[Moment.js](https://momentjs.com/)|
232+
|Import from |`@angular/material-moment-adapter`|
233+
234+
*Please note: `MatNativeDateModule` is based off the functionality available in JavaScript's
235+
native [`Date` object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date).
236+
Thus it is not suitable for many locales. One of the biggest shortcomings of the native `Date`
237+
object is the inability to set the parse format. We highly recommend using the `MomentDateAdapter`
238+
or a custom `DateAdapter` that works with the formatting/parsing library of your choice.*
239+
240+
These modules include providers for `DateAdapter` and `MAT_DATE_FORMATS`.
227241

228242
```ts
229243
@NgModule({
@@ -292,7 +306,7 @@ export class MyApp {}
292306

293307
#### Customizing the parse and display formats
294308

295-
The `MAT_DATE_FORMATS` object is just a collection of formats that the datepicker uses when parsing
309+
The `MAT_DATE_FORMATS` object is a collection of formats that the datepicker uses when parsing
296310
and displaying dates. These formats are passed through to the `DateAdapter` so you will want to make
297311
sure that the format objects you're using are compatible with the `DateAdapter` used in your app.
298312

0 commit comments

Comments
 (0)