-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datepicker: create injectable for date formats and bundle it along wi…
…th date adapter into MdNativeDateModule (#4296) * New module structure for DateAdapter. * pass through format options * move date-formats to core/datetime * don't subclass error * add test for missing providers case
- Loading branch information
Showing
21 changed files
with
494 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {InjectionToken} from '@angular/core'; | ||
|
||
|
||
export type MdDateFormats = { | ||
parse: { | ||
dateInput: any | ||
}, | ||
display: { | ||
dateInput: any, | ||
monthYearLabel: any, | ||
} | ||
}; | ||
|
||
|
||
export const MD_DATE_FORMATS = new InjectionToken<MdDateFormats>('md-date-formats'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {MdDateFormats} from './date-formats'; | ||
|
||
|
||
export const MD_NATIVE_DATE_FORMATS: MdDateFormats = { | ||
parse: { | ||
dateInput: null, | ||
}, | ||
display: { | ||
dateInput: {year: 'numeric', month: 'numeric', day: 'numeric'}, | ||
monthYearLabel: {year: 'numeric', month: 'short'}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @docs-private */ | ||
export function createMissingDateImplError(provider: string) { | ||
return new Error( | ||
`MdDatepicker: No provider found for ${provider}. You must import one of the following` + | ||
`modules at your application root: MdNativeDateModule, or provide a custom implementation.`); | ||
} |
Oops, something went wrong.