Skip to content

Commit

Permalink
Merge pull request #1 from Gillardo/master
Browse files Browse the repository at this point in the history
Merge from upstream
  • Loading branch information
N0NamedGuy authored Jan 18, 2017
2 parents 1d6d1a8 + ecc3e5b commit da2f406
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 31 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-ui-datetime-picker",
"version": "2.4.4",
"version": "2.5.0",
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"authors": [
"Gillardo <[email protected]>"
Expand Down
23 changes: 17 additions & 6 deletions datetime-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,33 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
show: true,
now: {
show: true,
text: 'Now'
text: 'Now',
cls: 'btn-sm btn-default'
},
today: {
show: true,
text: 'Today'
text: 'Today',
cls: 'btn-sm btn-default'
},
clear: {
show: true,
text: 'Clear'
text: 'Clear',
cls: 'btn-sm btn-default'
},
date: {
show: true,
text: 'Date'
text: 'Date',
cls: 'btn-sm btn-default'
},
time: {
show: true,
text: 'Time'
text: 'Time',
cls: 'btn-sm btn-default'
},
close: {
show: true,
text: 'Close'
text: 'Close',
cls: 'btn-sm btn-default'
}
},
closeOnDateSelection: true,
Expand Down Expand Up @@ -276,6 +282,11 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
return $scope.buttonBar[key].text || uiDatetimePickerConfig.buttonBar[key].text;
};

// get class
$scope.getClass = function (key) {
return $scope.buttonBar[key].cls || uiDatetimePickerConfig.buttonBar[key].cls;
};

$scope.keydown = function (evt) {
if (evt.which === 27) {
$scope.close(false);
Expand Down
31 changes: 21 additions & 10 deletions dist/datetime-picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/Gillardo/bootstrap-ui-datetime-picker
// Version: 2.4.4
// Released: 2016-11-01
// Version: 2.5.0
// Released: 2017-01-12
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
.constant('uiDatetimePickerConfig', {
dateFormat: 'yyyy-MM-dd HH:mm',
Expand All @@ -18,27 +18,33 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
show: true,
now: {
show: true,
text: 'Now'
text: 'Now',
cls: 'btn-sm btn-default'
},
today: {
show: true,
text: 'Today'
text: 'Today',
cls: 'btn-sm btn-default'
},
clear: {
show: true,
text: 'Clear'
text: 'Clear',
cls: 'btn-sm btn-default'
},
date: {
show: true,
text: 'Date'
text: 'Date',
cls: 'btn-sm btn-default'
},
time: {
show: true,
text: 'Time'
text: 'Time',
cls: 'btn-sm btn-default'
},
close: {
show: true,
text: 'Close'
text: 'Close',
cls: 'btn-sm btn-default'
}
},
closeOnDateSelection: true,
Expand Down Expand Up @@ -279,6 +285,11 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
return $scope.buttonBar[key].text || uiDatetimePickerConfig.buttonBar[key].text;
};

// get class
$scope.getClass = function (key) {
return $scope.buttonBar[key].cls || uiDatetimePickerConfig.buttonBar[key].cls;
};

$scope.keydown = function (evt) {
if (evt.which === 27) {
$scope.close(false);
Expand Down Expand Up @@ -659,12 +670,12 @@ angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($t
'use strict';

$templateCache.put('template/date-picker.html',
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=\"$event.preventDefault(); $event.stopPropagation()\"><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today', $event)\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear', $event)\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=\"close(true, $event)\">{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=\"$event.preventDefault(); $event.stopPropagation()\"><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=btn ng-class=\"getClass('today')\" ng-if=\"doShow('today')\" ng-click=\"select('today', $event)\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=btn ng-class=\"getClass('clear')\" ng-if=\"doShow('clear')\" ng-click=\"select('clear', $event)\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=btn ng-class=\"getClass('time')\" ng-if=\"doShow('time') && enableTime\" ng-click=\"open('time', $event)\">{{ getText('time')}}</button> <button type=button class=btn ng-class=\"getClass('close')\" ng-if=\"doShow('close')\" ng-click=\"close(true, $event)\">{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
);


$templateCache.put('template/time-picker.html',
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=\"$event.preventDefault(); $event.stopPropagation()\"><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now', $event)\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear', $event)\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=\"close(true, $event)\">{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=\"$event.preventDefault(); $event.stopPropagation()\"><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=btn ng-class=\"getClass('now')\" ng-if=\"doShow('now')\" ng-click=\"select('now', $event)\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=btn ng-class=\"getClass('clear')\" ng-if=\"doShow('clear')\" ng-click=\"select('clear', $event)\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=btn ng-class=\"getClass('date')\" ng-if=\"doShow('date') && enableDate\" ng-click=\"open('date', $event)\">{{ getText('date')}}</button> <button type=button class=btn ng-class=\"getClass('close')\" ng-if=\"doShow('close')\" ng-click=\"close(true, $event)\">{{ getText('close') }}</button></span> <span class=clearfix></span></li></ul>"
);

}]);
Loading

0 comments on commit da2f406

Please sign in to comment.