This repository was archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(datepicker): is-open attribute, ability to hide icons, demo layout #8743
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,59 +1,80 @@ | ||
<div ng-controller="AppCtrl" style='padding: 40px;' ng-cloak> | ||
<md-content> | ||
|
||
<h4>Standard date-picker</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker> | ||
|
||
<h4>Disabled date-picker</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" disabled></md-datepicker> | ||
|
||
<h4>Date-picker with min date and max date</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-min-date="minDate" md-max-date="maxDate"></md-datepicker> | ||
|
||
<h4>Only weekends are selectable</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
|
||
<h4>Only weekends within given range are selectable</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-min-date="minDate" md-max-date="maxDate" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
|
||
<h4>Opening the calendar when the input is focused</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-open-on-focus></md-datepicker> | ||
|
||
<h4>With ngMessages</h4> | ||
<form name="myForm"> | ||
<md-datepicker name="dateField" ng-model="myDate" md-placeholder="Enter date" | ||
required md-min-date="minDate" md-max-date="maxDate" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
|
||
<div class="validation-messages" ng-messages="myForm.dateField.$error"> | ||
<div ng-message="valid">The entered value is not a date!</div> | ||
<div ng-message="required">This date is required!</div> | ||
<div ng-message="mindate">Date is too early!</div> | ||
<div ng-message="maxdate">Date is too late!</div> | ||
<div ng-message="filtered">Only weekends are allowed!</div> | ||
<div ng-controller="AppCtrl" ng-cloak> | ||
<md-content layout-padding> | ||
|
||
<div layout-gt-xs="row"> | ||
<div flex-gt-xs> | ||
<h4>Standard date-picker</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker> | ||
</div> | ||
|
||
<div flex-gt-xs> | ||
<h4>Disabled date-picker</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" disabled></md-datepicker> | ||
</div> | ||
</div> | ||
|
||
<div layout-gt-xs="row"> | ||
<div flex-gt-xs> | ||
<h4>Date-picker with min date and max date</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-min-date="minDate" md-max-date="maxDate"></md-datepicker> | ||
</div> | ||
|
||
<div flex-gt-xs> | ||
<h4>Only weekends are selectable</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<h4>Inside a md-input-container</h4> | ||
<form name="myOtherForm"> | ||
<md-input-container> | ||
<label>Enter date</label> | ||
<div layout-gt-xs="row"> | ||
<div flex-gt-xs> | ||
<h4>Only weekends within given range are selectable</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-min-date="minDate" md-max-date="maxDate" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
</div> | ||
|
||
<div flex-gt-xs> | ||
<h4>Opening the calendar when the input is focused</h4> | ||
<md-datepicker ng-model="myDate" md-placeholder="Enter date" | ||
md-open-on-focus></md-datepicker> | ||
</div> | ||
</div> | ||
|
||
<md-datepicker ng-model="myDate" name="dateField" md-min-date="minDate" | ||
md-max-date="maxDate"></md-datepicker> | ||
<div layout-gt-xs="row"> | ||
<form name="myForm" flex-gt-xs> | ||
<h4>With ngMessages</h4> | ||
<md-datepicker name="dateField" ng-model="myDate" md-placeholder="Enter date" | ||
required md-min-date="minDate" md-max-date="maxDate" | ||
md-date-filter="onlyWeekendsPredicate"></md-datepicker> | ||
|
||
<div class="validation-messages" ng-messages="myOtherForm.dateField.$error"> | ||
<div class="validation-messages" ng-messages="myForm.dateField.$error"> | ||
<div ng-message="valid">The entered value is not a date!</div> | ||
<div ng-message="required">This date is required!</div> | ||
<div ng-message="mindate">Date is too early!</div> | ||
<div ng-message="maxdate">Date is too late!</div> | ||
<div ng-message="filtered">Only weekends are allowed!</div> | ||
</div> | ||
</md-input-container> | ||
</form> | ||
</form> | ||
|
||
<form name="myOtherForm" flex-gt-xs> | ||
<h4>Inside a md-input-container</h4> | ||
|
||
<md-input-container> | ||
<label>Enter date</label> | ||
<md-datepicker ng-model="myDate" name="dateField" md-min-date="minDate" | ||
md-max-date="maxDate"></md-datepicker> | ||
|
||
<div class="validation-messages" ng-messages="myOtherForm.dateField.$error"> | ||
<div ng-message="valid">The entered value is not a date!</div> | ||
<div ng-message="required">This date is required!</div> | ||
<div ng-message="mindate">Date is too early!</div> | ||
<div ng-message="maxdate">Date is too late!</div> | ||
</div> | ||
</md-input-container> | ||
</form> | ||
</div> | ||
|
||
</md-content> | ||
</div> |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice idea 👍