bootstrap-ui-datetime-picker
bootstrap-ui-datetime-picker copied to clipboard
custom buttonBar is error:TypeError: Cannot read property 'show' of undefined
the example is the same question
html:
<input type="text" class="form-control" datetime-picker="mediumDate" ng-model="ctrl.picker12.date" is-open="ctrl.picker12.open" enable-time="false" button-bar="ctrl.picker12.buttonBar" />
js:
this.picker12 = { date: new Date(), buttonBar: { show: true, now: { show: true, text: 'Now!' }, today: { show: true, text: 'Today!' }, clear: { show: false, text: 'Wipe' }, date: { show: true, text: 'Date' }, time: { show: true, text: 'Time' }, close: { show: true, text: 'Shut' } } };
error:
TypeError: Cannot read property 'show' of undefined
at m.$scope.doShow (datetime-picker.js:338)
you need to specify the cancel button too in the buttonBar config:
cancel: {
show: true,
text: 'Cancel',
cls: 'btn-sm btn-default'
}
it works ,thanks