Skip to content

Commit 58c252f

Browse files
crisbetojelbourn
authored andcommitted
fix(datepicker): export MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS (#4541)
* Makes the MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS public. * Fixes some trailing whitespace in the datepicker readme. Fixes #4534.
1 parent d2d67f5 commit 58c252f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/lib/core/datetime/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {MD_NATIVE_DATE_FORMATS} from './native-date-formats';
66

77

88
export * from './date-adapter';
9+
export * from './date-formats';
910
export * from './native-date-adapter';
11+
export * from './native-date-formats';
1012

1113

1214
@NgModule({

src/lib/datepicker/datepicker.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The month or year that the calendar opens to is determined by first checking if
4949
currently selected, if so it will open to the month or year containing that date. Otherwise it will
5050
open to the month or year containing today's date. This behavior can be overridden by using the
5151
`startAt` property of `md-datepicker`. In this case the calendar will open to the month or year
52-
containing the `startAt` date.
52+
containing the `startAt` date.
5353

5454
```ts
5555
startDate = new Date(1990, 0, 1);
@@ -66,7 +66,7 @@ There are three properties that add date validation to the datepicker input. The
6666
disable all dates on the calendar popup before or after the respective values and prevent the user
6767
from advancing the calendar past the `month` or `year` (depending on current view) containing the
6868
`min` or `max` date.
69-
69+
7070
The second way to add date validation is using the `mdDatepickerFilter` property of the datepicker
7171
input. This property accepts a function of `<D> => boolean` (where `<D>` is the date type used by
7272
the datepicker, see section on
@@ -78,7 +78,7 @@ dates before or after a certain point, will not prevent the user from advancing
7878
that point.
7979

8080
```ts
81-
myFilter = (d: Date) => d.getFullYear() > 2005
81+
myFilter = (d: Date) => d.getFullYear() > 2005
8282
minDate = new Date(2000, 0, 1);
8383
maxDate = new Date(2020, 11, 31);
8484
```
@@ -111,7 +111,7 @@ The calendar popup can be programmatically controlled using the `open` and `clos
111111
@Component({...})
112112
export class MyComponent implements AfterViewInit {
113113
@ViewChild(MdDatepicker) dp: MdDatepicker<Date>;
114-
114+
115115
ngAfterViewInit() {
116116
dp.open();
117117
}
@@ -126,7 +126,7 @@ The easiest way to ensure this is just to import one of the pre-made modules (cu
126126
`MdNativeDateModule` is the only implementation that ships with material, but there are plans to add
127127
a module for Moment.js support):
128128
* `MdNativeDateModule` - support for native JavaScript Date object
129-
129+
130130
These modules include providers for `DateAdapter` and `MD_DATE_FORMATS`
131131

132132
```ts

0 commit comments

Comments
 (0)