3 Answers, 1 is accepted
0
Hello,
It possible to have the DatePicker widget read the date without separators. You just need to specify the format that will be used in the parseFormats option. The definition in the .NET Core wrapper would look similar to this:
Give the configuration a try and let me know how it works for you.
Regards,
Viktor Tachev
Progress Telerik
It possible to have the DatePicker widget read the date without separators. You just need to specify the format that will be used in the parseFormats option. The definition in the .NET Core wrapper would look similar to this:
@(Html.Kendo().DatePicker()
.Name(
"datepicker"
)
.Format(
"mm/dd/yyyy"
)
.ParseFormats(
new
string
[] {
"MMddyyyy"
})
)
Give the configuration a try and let me know how it works for you.
Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

JP13
Top achievements
Rank 1
answered on 10 Jun 2019, 01:47 PM
That works but causes another issue.
I have the following Javascript
function
TermStartDateChange() {
var
jsTermStartDate = kendo.toString(
this
.value(),
'd'
);
$(
'#iDOStartDate'
).data(
'kendoDatePicker'
).value(jsTermStartDate);
}
When I put the string '070119' into my control, it will adjust it 07/01/2019 correctly, but the other field gets a value of 01/01/2019. The debugger shows this.value as 'Tue Jan 01 2019 00:07:00 GMT-0500 (Eastern Standard Time)'. Before I put the format and parseformats on my fields my script would correctly populate the new field. I also notice that if I enter 070119 into my control, and then click on the calendar icon to change the date, the dropdown shows the date as Jan 1 2019 as well.
What do I need to adjust to get the correct date in the new field as well as showing the entered date within the calendar?
0
Hello,
If you would like to parse a value as date from a specific format I would recommend taking advantage of the kendo.parseDate method and specifying the formats used for parsing explicitly.
In case the behavior is not working as expected on your end please send us a dojo sample or a runnable project where the issue is replicated so we can examine it.
Regards,
Viktor Tachev
Progress Telerik
If you would like to parse a value as date from a specific format I would recommend taking advantage of the kendo.parseDate method and specifying the formats used for parsing explicitly.
In case the behavior is not working as expected on your end please send us a dojo sample or a runnable project where the issue is replicated so we can examine it.
Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.