Skip to content

fix(datepicker): export MD_DATE_FORMATS and MD_NATIVE_DATE_FORMATS #4541

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

Merged
merged 1 commit into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/core/datetime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {MD_NATIVE_DATE_FORMATS} from './native-date-formats';


export * from './date-adapter';
export * from './date-formats';
export * from './native-date-adapter';
export * from './native-date-formats';


@NgModule({
Expand Down
10 changes: 5 additions & 5 deletions src/lib/datepicker/datepicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The month or year that the calendar opens to is determined by first checking if
currently selected, if so it will open to the month or year containing that date. Otherwise it will
open to the month or year containing today's date. This behavior can be overridden by using the
`startAt` property of `md-datepicker`. In this case the calendar will open to the month or year
containing the `startAt` date.
containing the `startAt` date.

```ts
startDate = new Date(1990, 0, 1);
Expand All @@ -66,7 +66,7 @@ There are three properties that add date validation to the datepicker input. The
disable all dates on the calendar popup before or after the respective values and prevent the user
from advancing the calendar past the `month` or `year` (depending on current view) containing the
`min` or `max` date.

The second way to add date validation is using the `mdDatepickerFilter` property of the datepicker
input. This property accepts a function of `<D> => boolean` (where `<D>` is the date type used by
the datepicker, see section on
Expand All @@ -78,7 +78,7 @@ dates before or after a certain point, will not prevent the user from advancing
that point.

```ts
myFilter = (d: Date) => d.getFullYear() > 2005
myFilter = (d: Date) => d.getFullYear() > 2005
minDate = new Date(2000, 0, 1);
maxDate = new Date(2020, 11, 31);
```
Expand Down Expand Up @@ -111,7 +111,7 @@ The calendar popup can be programmatically controlled using the `open` and `clos
@Component({...})
export class MyComponent implements AfterViewInit {
@ViewChild(MdDatepicker) dp: MdDatepicker<Date>;

ngAfterViewInit() {
dp.open();
}
Expand All @@ -126,7 +126,7 @@ The easiest way to ensure this is just to import one of the pre-made modules (cu
`MdNativeDateModule` is the only implementation that ships with material, but there are plans to add
a module for Moment.js support):
* `MdNativeDateModule` - support for native JavaScript Date object

These modules include providers for `DateAdapter` and `MD_DATE_FORMATS`

```ts
Expand Down