Skip to content

Commit 6ef58a2

Browse files
Splaktarjelbourn
authored andcommitted
docs(datepicker): convert date module tables to be mobile-friendly (#18210)
Fixes angular/material.angular.io#686
1 parent b163b64 commit 6ef58a2

File tree

1 file changed

+56
-14
lines changed

1 file changed

+56
-14
lines changed

src/material/datepicker/datepicker.md

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,62 @@ 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`|
219-
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.*
225-
226-
These modules include providers for `DateAdapter` and `MAT_DATE_FORMATS`
214+
The easiest way to ensure this is to import one of the provided date modules:
215+
216+
`MatNativeDateModule`
217+
218+
<table>
219+
<tbody>
220+
<tr>
221+
<th align="left" scope="row">Date type</th>
222+
<td><code>Date</code></td>
223+
</tr>
224+
<tr>
225+
<th align="left" scope="row">Supported locales</th>
226+
<td>en-US</td>
227+
</tr>
228+
<tr>
229+
<th align="left" scope="row">Dependencies</th>
230+
<td>None</td>
231+
</tr>
232+
<tr>
233+
<th align="left" scope="row">Import from</th>
234+
<td><code>@angular/material/core</code></td>
235+
</tr>
236+
</tbody>
237+
</table>
238+
239+
`MatMomentDateModule`
240+
241+
<table>
242+
<tbody>
243+
<tr>
244+
<th align="left" scope="row">Date type</th>
245+
<td><code>Moment</code></td>
246+
</tr>
247+
<tr>
248+
<th align="left" scope="row">Supported locales</th>
249+
<td><a href="https://github.com/moment/moment/tree/develop/src/locale) for details">See project</a></td>
250+
</tr>
251+
<tr>
252+
<th align="left" scope="row">Dependencies</th>
253+
<td><a href="https://momentjs.com/">Moment.js</a></td>
254+
</tr>
255+
<tr>
256+
<th align="left" scope="row">Import from</th>
257+
<td><code>@angular/material-moment-adapter</code></td>
258+
</tr>
259+
</tbody>
260+
</table>
261+
262+
*Please note: `MatNativeDateModule` is based off the functionality available in JavaScript's
263+
native [`Date` object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date).
264+
Thus it is not suitable for many locales. One of the biggest shortcomings of the native `Date`
265+
object is the inability to set the parse format. We highly recommend using the `MomentDateAdapter`
266+
or a custom `DateAdapter` that works with the formatting/parsing library of your choice.*
267+
268+
These modules include providers for `DateAdapter` and `MAT_DATE_FORMATS`.
227269

228270
```ts
229271
@NgModule({
@@ -292,7 +334,7 @@ export class MyApp {}
292334

293335
#### Customizing the parse and display formats
294336

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

0 commit comments

Comments
 (0)