-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular-material): Date Picker Format and View
Use a custom dateFormatter to enable the date picker format option. Enable the JSON Forms view options.
- Loading branch information
Showing
11 changed files
with
197 additions
and
76 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
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,24 @@ | ||
import { Injectable } from '@angular/core'; | ||
|
||
@Injectable() | ||
export class MyFormat { | ||
displayFormat = 'M/D/YYYY'; | ||
|
||
setDisplayFormat(displayFormat: string) { | ||
this.displayFormat = displayFormat; | ||
} | ||
|
||
get display() { | ||
return { | ||
monthYearLabel: 'YYYY-MM', | ||
dateA11yLabel: 'YYYY-MM-DD', | ||
monthYearA11yLabel: 'YYYY-MM', | ||
dateInput: this.displayFormat, | ||
}; | ||
} | ||
get parse() { | ||
return { | ||
dateInput: this.displayFormat, | ||
}; | ||
} | ||
} |
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
Oops, something went wrong.