How to remove/change <sp-date-picker> tooltip

jpeterson4
Tera Contributor

Hello, I've created a <sp-date-picker> using most of the code from this: Solved: Re: Date Picker in widget is not showing correct d... - ServiceNow Community

The problem is that the calendar has a hover over tooltip that reads "Show Calendar for {0}". How do I get rid of this entirely or change it to say something else?

 

tooltip.png

1 ACCEPTED SOLUTION

Vaibhav127
Tera Guru

Hi jpeterson4,

 

you can use jquery to change the title.

$(document).on('mouseenter', "button[aria-label='Show Calendar for {0}']", function() {
$("button[aria-label='Show Calendar for {0}']").attr('title', 'NEW_TITLE').tooltip('fixTitle').tooltip('show');
});

View solution in original post

7 REPLIES 7

Vaibhav127
Tera Guru

Hi jpeterson4,

 

you can use jquery to change the title.

$(document).on('mouseenter', "button[aria-label='Show Calendar for {0}']", function() {
$("button[aria-label='Show Calendar for {0}']").attr('title', 'NEW_TITLE').tooltip('fixTitle').tooltip('show');
});

Thank you so much!

Any idea how to get rid of the tooltip entirely?

Hi Jeffrey Siegel,

You can try the following code to make empty the tooltip:

setTimeout(function() {
$("button[aria-label='Show Calendar for {0}']").attr('title', '');
$("button[aria-label='Show Calendar for {0}']").attr('data-original-title', '');
}, 100);