How do I edit the mask text displayed in the kendo timepicker?

1 Answer 467 Views
DatePicker
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Lee asked on 22 Jul 2021, 07:33 PM

I am using the Kendo UI JQuery timepicker with the defaults and the option dateInput: true. When no time has been entered the placeholder text reads, "hours:minutes AM/PM". This is too long to fit in the box and gets cut off at the letter "A". I would like to shorten it to something like "hh:mm am/pm". How would I do this?


$("#myTime").kendoTimePicker({
        dateInput: true,
    });

1 Answer, 1 is accepted

Sort by
0
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
answered on 26 Jul 2021, 05:29 PM | edited on 26 Jul 2021, 05:30 PM

I found the answer here: 
https://www.telerik.com/forums/kendo-ui-date-picker-with-dateinput-change-in-how-mask-displays

Basically, after creating the date picker do something like this: 


var myPicker = $("#time").data("kendoTimePicker);
myPicker._dateInput.setOptions({
    messages: {
        hour: "hh",
        minute: "mm",
        ...
     }
});

Nikolay
Telerik team
commented on 27 Jul 2021, 06:24 AM

Hi Lee,

I am happy to hear you managed to find what you were looking for.

Indeed, this is the right way of setting custom messages for the TimePicker DateInput.

Regards,

Nikolay

Tags
DatePicker
Asked by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Answers by
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
Share this question
or