Hi Allan,
Thanks for contacting Syncfusion support.
We have checked with your query. We suggest to use “htmlAttributes” API to set the tooltip for the DatePicker component initially. By using this API, you can add custom attribute to the DatePicker component. Please refer the below code example.
Index.cshtml:
@{ IDictionary<string, object> htmlAttr = new Dictionary<string, object>();
string value = "hi";
htmlAttr.Add("title", value);
}
<ej-date-picker id="DatePick1" html-attributes="htmlAttr”></ej-date-picker>
|
Also, if you are using multiple datepicker in the page, you can achieve your requirement (“I have been requested to add a tooltip that displays the selected date in the users Long Date format to all date fields”) by using our “change” event in your application. This will update your tooltip text whenever the value changes in DatePicker component.
We suggest you to use ej.format() in your sample that will used to convert the date value as the desired format. Then you have to store this date value in the private variable and set this value to the “htmlAttributes” API by using the below code example.
Index.cshtml:
<ej-date-picker id="DatePick2" change="onChange"></ej-date-picker>
<ej-date-picker id="DatePick3" change="onChange"></ej-date-picker>
<ej-date-picker id="DatePick4" change="onChange"></ej-date-picker>
<script>
function onChange(args)
{
var date = ej.format(this.model.value, "dddd, d MMMM, yy", this.model.locale);
this.option("htmlAttributes", { title: date });
}
</script> |
For your convenience, we have prepared the sample based on your requirement. Please get the sample from the below location.
To know more about our API’s, events and methods please refer the below API Documentation link.
Please refer the below link to kow more about our DatePicker component in ASP.NET Core.
If still you are facing issues please get back to us with more details that will help us to provide exact solution.
Regards,
Berly B.C