When inside the timepicker, hovering over the calendar icon displays the tooltip Select Time instead of Select Date.
Add the variable $link.
togglePicker: function (e) {
var $this = $(e.target),
$link = $this.closest('a'),
$parent = $this.closest('ul'),
expanded = $parent.find('.show'),
closed = $parent.find('.collapse:not(.show)'),
collapseData;
if (expanded && expanded.length) {
collapseData = expanded.data('collapse');
if (collapseData && collapseData.transitioning) {
return;
}
if (expanded.collapse) { // if collapse plugin is available through bootstrap.js then use it
expanded.collapse('hide');
closed.collapse('show');
} else { // otherwise just toggle in class on the two views
expanded.removeClass('show');
closed.addClass('show');
}
if ($this.is('i')) {
$this.toggleClass(options.icons.time + ' ' + options.icons.date);
if ($this.hasClass(options.icons.date)) {
$link.attr('title', options.tooltips.selectDate);
} else {
$link.attr('title', options.tooltips.selectTime);
}
} else {
$this.find('i').toggleClass(options.icons.time + ' ' + options.icons.date);
if ($this.find('i').hasClass(options.icons.date)) {
$link.attr('title', options.tooltips.selectDate);
} else {
$link.attr('title', options.tooltips.selectTime);
}
}
// NOTE: uncomment if toggled state will be restored in show()
//if (component) {
// component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
//}
}
},