Skip to content

Commit 63f0b18

Browse files
Merge branch 'master' into master-dist
2 parents e96ec27 + cbe92ad commit 63f0b18

File tree

55 files changed

+7278
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+7278
-172
lines changed

Gruntfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ module.exports = function (grunt) {
128128
'lib/bootstrap/dist/js/bootstrap.js',
129129
'lib/bootstrap-combobox/js/bootstrap-combobox.js',
130130
'lib/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
131+
'lib/moment/moment.js',
132+
'lib/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js',
131133
'lib/bootstrap-select/js/bootstrap-select.js',
132134
'lib/patternfly-bootstrap-treeview/src/js/bootstrap-treeview.js',
133135
'lib/c3/c3.js',

dist/angular-patternfly.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,6 +3334,63 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
33343334
}
33353335
};
33363336
});
3337+
;/**
3338+
* @ngdoc directive
3339+
* @name patternfly.form.directive:pfDateTimepicker
3340+
*
3341+
* @description
3342+
* Angular directive to wrap the bootstrap datetimepicker http://eonasdan.github.io/bootstrap-datetimepicker/
3343+
*
3344+
* @param {object} date date and time moment object
3345+
* @param {string} options the configuration options for the date picker
3346+
*
3347+
* @example
3348+
<example module="patternfly.form">
3349+
<file name="index.html">
3350+
<form class="form" ng-controller="FormDemoCtrl">
3351+
<span>Date and Time: <span ng-bind="date"></span></span>
3352+
<div pf-date-timepicker options="options" date="date"></div>
3353+
</form>
3354+
</file>
3355+
3356+
<file name="script.js">
3357+
angular.module( 'patternfly.form' ).controller( 'FormDemoCtrl', function( $scope ) {
3358+
$scope.options = {
3359+
format: 'HH:mm'
3360+
};
3361+
$scope.date = moment();
3362+
});
3363+
</file>
3364+
</example>
3365+
*/
3366+
angular.module('patternfly.form').directive('pfDateTimepicker', function () {
3367+
'use strict';
3368+
3369+
return {
3370+
replace: true,
3371+
restrict: 'A',
3372+
require: '^form',
3373+
templateUrl: 'form/datetimepicker/datetimepicker.html',
3374+
scope: {
3375+
options: '=',
3376+
date: '='
3377+
},
3378+
link: function ($scope, element) {
3379+
//Make sure the date picker is set with the correct options
3380+
element.datetimepicker($scope.options);
3381+
3382+
//Set the initial value of the date picker
3383+
element.datetimepicker('date', $scope.date || null);
3384+
3385+
//Change happened on the date picker side. Update the underlying date model
3386+
element.on('dp.change', function (elem) {
3387+
$scope.$apply(function () {
3388+
$scope.date = elem.date;
3389+
});
3390+
});
3391+
}
3392+
};
3393+
});
33373394
;/**
33383395
* @ngdoc directive
33393396
* @name patternfly.form.directive:pfFormButtons
@@ -10147,6 +10204,11 @@ angular.module('patternfly.wizard').directive('pfWizardSubstep', function () {
1014710204
);
1014810205

1014910206

10207+
$templateCache.put('form/datetimepicker/datetimepicker.html',
10208+
"<div class=\"input-group time-picker-pf\"><input class=\"form-control\"> <span class=\"input-group-addon btn btn-default\"><span class=\"fa fa-clock-o\"></span></span></div>"
10209+
);
10210+
10211+
1015010212
$templateCache.put('form/form-buttons/form-buttons.html',
1015110213
"<div class=form-group><div class=\"{{ pfButtonContainerClass }}\"><div class=\"control-group buttons\"><button class=\"btn btn-default\" type=button ng-click=pfHandleCancel() ng-disabled=pfWorking translate>Cancel</button> <button class=\"btn btn-primary\" ng-click=\"pfHandleSave(); pfWorking = true\" ng-disabled=\"isInvalid() || pfWorking\"><i class=\"icon-spinner icon-spin\" ng-show=pfWorking></i> <span ng-show=pfWorking translate>Saving...</span> <span ng-hide=pfWorking translate>Save</span></button></div></div></div>"
1015210214
);

dist/angular-patternfly.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docs/grunt-scripts/angular-patternfly.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,6 +3334,63 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
33343334
}
33353335
};
33363336
});
3337+
;/**
3338+
* @ngdoc directive
3339+
* @name patternfly.form.directive:pfDateTimepicker
3340+
*
3341+
* @description
3342+
* Angular directive to wrap the bootstrap datetimepicker http://eonasdan.github.io/bootstrap-datetimepicker/
3343+
*
3344+
* @param {object} date date and time moment object
3345+
* @param {string} options the configuration options for the date picker
3346+
*
3347+
* @example
3348+
<example module="patternfly.form">
3349+
<file name="index.html">
3350+
<form class="form" ng-controller="FormDemoCtrl">
3351+
<span>Date and Time: <span ng-bind="date"></span></span>
3352+
<div pf-date-timepicker options="options" date="date"></div>
3353+
</form>
3354+
</file>
3355+
3356+
<file name="script.js">
3357+
angular.module( 'patternfly.form' ).controller( 'FormDemoCtrl', function( $scope ) {
3358+
$scope.options = {
3359+
format: 'HH:mm'
3360+
};
3361+
$scope.date = moment();
3362+
});
3363+
</file>
3364+
</example>
3365+
*/
3366+
angular.module('patternfly.form').directive('pfDateTimepicker', function () {
3367+
'use strict';
3368+
3369+
return {
3370+
replace: true,
3371+
restrict: 'A',
3372+
require: '^form',
3373+
templateUrl: 'form/datetimepicker/datetimepicker.html',
3374+
scope: {
3375+
options: '=',
3376+
date: '='
3377+
},
3378+
link: function ($scope, element) {
3379+
//Make sure the date picker is set with the correct options
3380+
element.datetimepicker($scope.options);
3381+
3382+
//Set the initial value of the date picker
3383+
element.datetimepicker('date', $scope.date || null);
3384+
3385+
//Change happened on the date picker side. Update the underlying date model
3386+
element.on('dp.change', function (elem) {
3387+
$scope.$apply(function () {
3388+
$scope.date = elem.date;
3389+
});
3390+
});
3391+
}
3392+
};
3393+
});
33373394
;/**
33383395
* @ngdoc directive
33393396
* @name patternfly.form.directive:pfFormButtons
@@ -10147,6 +10204,11 @@ angular.module('patternfly.wizard').directive('pfWizardSubstep', function () {
1014710204
);
1014810205

1014910206

10207+
$templateCache.put('form/datetimepicker/datetimepicker.html',
10208+
"<div class=\"input-group time-picker-pf\"><input class=\"form-control\"> <span class=\"input-group-addon btn btn-default\"><span class=\"fa fa-clock-o\"></span></span></div>"
10209+
);
10210+
10211+
1015010212
$templateCache.put('form/form-buttons/form-buttons.html',
1015110213
"<div class=form-group><div class=\"{{ pfButtonContainerClass }}\"><div class=\"control-group buttons\"><button class=\"btn btn-default\" type=button ng-click=pfHandleCancel() ng-disabled=pfWorking translate>Cancel</button> <button class=\"btn btn-primary\" ng-click=\"pfHandleSave(); pfWorking = true\" ng-disabled=\"isInvalid() || pfWorking\"><i class=\"icon-spinner icon-spin\" ng-show=pfWorking></i> <span ng-show=pfWorking translate>Saving...</span> <span ng-hide=pfWorking translate>Save</span></button></div></div></div>"
1015210214
);

0 commit comments

Comments
 (0)