Open joseglego opened 8 years ago
did you find a workaround ?
Hello @MaxDhn, no I didn't. I changed to other library, and neither have this functionality. You will need:
Steps
I hope it help you!
I'm using this in Angular-Formly and was able to hook-up the button via the link function:
var input = $(el.find('input')).datetimepicker(scope.to.dateTimePickerOptions); scope.datetimepicker = input.data("DateTimePicker");
And in the template:
`
<span class="input-group-addon" ng-click="datetimepicker.toggle()" ng-disabled="to.disabled">
<span class="fa fa-calendar"></span>
</span>
</div>`
It's working fine in my application. I'm new to Angular and Bootstrap, but I would suspect you could do something similar with an additional attribute or element directive that's doing the same thing.
I have the same issue, How to show datetimepicker when click on icon calendar ? Please take a look at: http://eonasdan.github.io/bootstrap-datetimepicker/
Hi @diosney, Could you fix the issue please?
I have fixed the issue on PullRequest 32 (https://github.com/diosney/angular-bootstrap-datetimepicker-directive/pull/32). Please review my changes.
@franzeal I don't follow completely: where do you put this code?
var input = $(el.find('input')).datetimepicker(scope.to.dateTimePickerOptions);
scope.datetimepicker = input.data("DateTimePicker");
Is that in a script block within your page html?
@CJBrew I've got it in a link function on a formly type that wraps this datepicker.
The type's template looks like this:
`
<span class="input-group-addon" ng-click="datetimepicker.toggle()" ng-disabled="to.disabled">
<span class="fa fa-calendar"></span>
</span>
</div>`
The link function looks like this:
link: function (scope, el, attrs, ctrl) { // Enabling the calendar button var input = (<any>$(el.find('input'))).datetimepicker(scope.to.dateTimePickerOptions); scope.datetimepicker = input.data("DateTimePicker"); },
My default options look like this (I've removed all the validation related stuff I have in here for this example):
defaultOptions: { templateOptions: { dateTimePickerOptions: { locale: 'en', format: 'MM/DD/YYYY HH:mm', showTodayButton: true, showClear: true, icons: { time: 'fa fa-clock-o', date: 'fa fa-calendar', up: 'fa fa-chevron-up', down: 'fa fa-chevron-down', previous: 'fa fa-chevron-left', next: 'fa fa-chevron-right', today: 'fa fa-dot-circle-o', clear: 'fa fa-trash', close: 'fa fa-times', }, tooltips: { clear: 'Clear Selection', close: 'Close', today: 'Now' } } } }
It doesn't let you use a input-group-button to show the datetimepicker but the Eonasdan Datetimepicker lets you use it.