Skip to content

Commit 5325085

Browse files
committed
merge PR logbon72#99 compatible require
1 parent 46dd6eb commit 5325085

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ <h2>Datetime Pickers</h2>
175175
<div layout-gt-md="row" layout="column" layout-align-gt-md="center center">
176176
<div layout="row" flex-gt-md="30" layout-align="start center">
177177
<md-input-container md-float>
178-
<input type="date" ng-model="selectedDateTimeIn" id="dateinput">
178+
<input type="date" ng-model="selectedDateTimeIn" id="dateinput" aria-label="date picker">
179179
</md-input-container>
180180
<md-button class="md-primary md-icon-button" style="top:-12px;left:-12px;" ng-click="displayDialogIn()">
181181
<md-icon class="material-icons">today</md-icon>

js/angular-material-datetimepicker.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(function () {
22
'use strict';
3+
4+
function ngMaterialDatePicker(moment) {
35
var moduleName = "ngMaterialDatePicker";
46

57
var VIEW_STATES = {
@@ -1055,5 +1057,14 @@
10551057
}
10561058
};
10571059
}]);
1058-
1060+
}
1061+
1062+
var isElectron = window && window.process && window.process.type;
1063+
if (typeof define === 'function' && define.amd) {
1064+
define(['moment'], ngMaterialDatePicker);
1065+
} else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {
1066+
module.exports = ngMaterialDatePicker(require('moment'));
1067+
} else {
1068+
ngMaterialDatePicker((typeof global !== 'undefined' ? global : window).moment);
1069+
}
10591070
})();

js/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
.then(function (date) {
5151
$scope.selectedDateTime = date;
5252
console.log('New Date / Time selected:', date);
53-
});
53+
}, function(){});
5454
};
5555

5656
$scope.displayDialogIn = function () {
@@ -61,7 +61,7 @@
6161
})
6262
.then(function (date) {
6363
$scope.selectedDateTimeIn = date;
64-
});
64+
}, function(){});
6565
};
6666

6767
// Set and change the text direction

0 commit comments

Comments
 (0)