Skip to content

Commit

Permalink
merge PR logbon72#99 compatible require
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecy committed Jun 24, 2017
1 parent 46dd6eb commit 5325085
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h2>Datetime Pickers</h2>
<div layout-gt-md="row" layout="column" layout-align-gt-md="center center">
<div layout="row" flex-gt-md="30" layout-align="start center">
<md-input-container md-float>
<input type="date" ng-model="selectedDateTimeIn" id="dateinput">
<input type="date" ng-model="selectedDateTimeIn" id="dateinput" aria-label="date picker">
</md-input-container>
<md-button class="md-primary md-icon-button" style="top:-12px;left:-12px;" ng-click="displayDialogIn()">
<md-icon class="material-icons">today</md-icon>
Expand Down
13 changes: 12 additions & 1 deletion js/angular-material-datetimepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(function () {
'use strict';

function ngMaterialDatePicker(moment) {
var moduleName = "ngMaterialDatePicker";

var VIEW_STATES = {
Expand Down Expand Up @@ -1055,5 +1057,14 @@
}
};
}]);

}

var isElectron = window && window.process && window.process.type;
if (typeof define === 'function' && define.amd) {
define(['moment'], ngMaterialDatePicker);
} else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {
module.exports = ngMaterialDatePicker(require('moment'));
} else {
ngMaterialDatePicker((typeof global !== 'undefined' ? global : window).moment);
}
})();
4 changes: 2 additions & 2 deletions js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
.then(function (date) {
$scope.selectedDateTime = date;
console.log('New Date / Time selected:', date);
});
}, function(){});
};

$scope.displayDialogIn = function () {
Expand All @@ -61,7 +61,7 @@
})
.then(function (date) {
$scope.selectedDateTimeIn = date;
});
}, function(){});
};

// Set and change the text direction
Expand Down

0 comments on commit 5325085

Please sign in to comment.