Skip to content

Commit 3e466f1

Browse files
committed
#85 example with a normal input and the service
1 parent 6c4d4b6 commit 3e466f1

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

index.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<link rel="icon" type="image/png" href="favicon.png" />
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet" type="text/css">
10+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1011
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github.min.css" rel="stylesheet">
1112
<link href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.4/angular-material.min.css" rel="stylesheet" type="text/css"/>
1213
<link rel="stylesheet" href="./css/material-datetimepicker.css" type="text/css"/>
@@ -159,19 +160,29 @@ <h2>Datetime Pickers</h2>
159160
</div>
160161

161162
<div layout-gt-md="row" layout="column" layout-align-gt-md="center center">
162-
163163
<div flex-gt-md="30">
164164
<p>mdcDateTimeDialog Service</p>
165165
<md-button class="md-raised md-primary" ng-click="displayDialog()">
166166
Display Picker
167167
</md-button>
168168
<p ng-if="selectedDateTime">Date: {{selectedDateTime|date}}</p>
169169
</div>
170-
171170
<div flex-gt-md="grow" ex-source-code target="button"></div>
172-
173171
</div>
174172

173+
<br>
174+
<label>mdcDateTimeDialog Service Input</label>
175+
<div layout-gt-md="row" layout="column" layout-align-gt-md="center center">
176+
<div layout="row" flex-gt-md="30" layout-align="start center">
177+
<md-input-container md-float>
178+
<input type="date" ng-model="selectedDateTimeIn" id="dateinput">
179+
</md-input-container>
180+
<md-button class="md-primary md-icon-button" style="top:-12px;left:-12px;" ng-click="displayDialogIn()">
181+
<md-icon class="material-icons">today</md-icon>
182+
</md-button>
183+
</div>
184+
<div flex-gt-md="grow" ex-source-code target="input"></div>
185+
</div>
175186
</md-card-content>
176187

177188
</md-card>

js/demo.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@
5353
});
5454
};
5555

56+
$scope.displayDialogIn = function () {
57+
mdcDateTimeDialog.show({
58+
currentDate: $scope.selectedDateTimeIn || moment().startOf('day'),
59+
maxDate: $scope.maxDate,
60+
time: false
61+
})
62+
.then(function (date) {
63+
$scope.selectedDateTimeIn = date;
64+
});
65+
};
66+
5667
// Set and change the text direction
5768
$scope.txtdir = document.documentElement.dir || 'ltr';
5869
$scope.changeDir = function () {

0 commit comments

Comments
 (0)