Dear support,
I didn't find in your documentation if and how we can use data-* annotations to setup dataInput options of a datepicker.
I would like to do the same thing that the code below does but with MVVM data-* annotation.
self.date= $('#dateExample').kendoDatePicker({
format: 'dd.MM.yyyy',
dateInput: true,
}).data('kendoDatePicker');
self.date._dateInput.setOptions({
format: 'dd.MM.yyyy',
messages: {
'year': 'yyyy',
'month': 'mm',
'day': 'dd'
}I globally use data-bind for html and kendo UI components.
I just added the data-format in my html like below, and it works.
<input data-role="datepicker" id="dateExample" data-format="dd.MM.yyyy" data-bind="value: myValue">I wonder if we can setup format and messages options for the dateinput of the datepicker with MVVM without using jquery (with something like data-dateinput, data-dateinput-format, data-dateinput-messages...).
Thanks in advance for your usual support.
Regards,
Charline.
Dear Alex,
Thanks for your reply.
It was what I thought. I tried a lot of options with capital or dash/lower but it was not working as expected. It was the reason I decided to contact you.
As you replied that this is not supported, I handed it today with jquery code.
var datePickers = $("input[data-role='datepicker']");
datePickers.each((index, datePicker) => {
var kendoDatePicker = $(datePicker).kendoDatePicker({
format: 'dd.MM.yyyy',
dateInput: true,
parseFormats : ['dd.MM.yyyy','yyyy-MM-dd']
}).data('kendoDatePicker');
if (kendoDatePicker) {
kendoDatePicker._dateInput.setOptions({
format: 'dd.MM.yyyy',
messages: {
'year': 'yyyy',
'month': 'mm',
'day': 'dd'
}
});
}
});
For me this feature is a must-have for a full MVVM use, so yes, please kindly add it in the Feature Request list.
Thank you & Regards,
Charline.
data-date-input="true"data-date-input="{ messages: { month: 'mymonth'} }"