This is a migrated thread and some comments may be shown as answers.

Is there any difference in the Date/Time Pickers between the following versions?

2 Answers 34 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Hugo
Top achievements
Rank 1
Hugo asked on 21 Feb 2017, 11:18 AM

Hi there, 

Is there any difference globalisation/culture changes between the following versions: Kendo UI Complete v2013.1.319 and  Kendo UI v2017.1.118 ?

After upgrading I started getting the error: "  The field (insert field name) must be a date."

Do I need to upgrade the JQuery Version? Currently using v1.9.1

I'm setting the culture the same way. Using a script inside the page: 

kendo.culture("@(((CultureInfo)Session["culture"]).Name)");

 

The code for creating the DatePicker hasn't changed: 

@(Html.Kendo().DatePickerFor(model => model.DateOfTesting)
    .Name("DateOfTesting")
    .Format("dd MMM yyyy")
    .Culture(((CultureInfo)Session["Culture"]).Name)
    .HtmlAttributes(new { style = "width:100%" })
 )
@Html.ValidationMessageFor(model => model.DateOfTesting)

 

The scripts on my page are the same: 

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

 

The scripts on the Layout Page are the same

<script src="@Url.Content("~/Scripts/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo.web.min.js")"></script>
<script src="@Url.Content("~/Scripts/Cultures/kendo.culture.en.min.js")" type="text/javascript"></script>
 
@*Loading Multiple culture files in the Layout Page*@
<script src="@Url.Content("~/Scripts/Cultures/kendo.culture.en-US.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Cultures/kendo.culture.en-GB.min.js")" type="text/javascript"></script>
@*and so on for each culture*@
<script src="@Url.Content("~/Scripts/Cultures/kendo.culture.CULTURE .min.js")" type="text/javascript"></script>

Note: The last line is just an example

 

If I revert to the previous version ir works properly, if I upgrade then it doesn't with the exact same code.

Any idea?

Thank you

2 Answers, 1 is accepted

Sort by
0
Hugo
Top achievements
Rank 1
answered on 21 Feb 2017, 11:35 AM

I forgot to add that I have this on my $(document).ready function, but the code isn't reaching this point. 

$(document).ready(function () {
    var validator = $("#MyForm").kendoValidator().data("kendoValidator");
    $("input[type=submit]").click(function (e) {
        if (!validator.validate()) {
            e.preventDefault();
        } else {
            $("input[type=submit]").attr("disabled", "disabled");
            $("input[type=submit]").addClass("k-state-disabled");
            window.onbeforeunload = null;
            $('form[method="post"]')[0].submit();
        }
    });
}

 

And there is a way to get this working by using a suggestion from another post,

<script>
    kendo.ui.validator.rules.mvcdate = function (input) {
      return input.val() === "" || kendo.parseDate(input.val(), "dd MMM yyyy") !== null;
    }
</script>

 

what is confusing/bothering me is why it works with the previous version...

Thanks, 

 

0
Stefan
Telerik team
answered on 23 Feb 2017, 08:20 AM
Hello Hugo,

I'm glad to hear that the issue is resolved.

As for the specific changes, as there are nearly 4 years between those versions, many new changes were made.

Also, the culture formats may be changed for the specific culture.

If additional investigation is needed, please provide a fully runnable example, so I can inspect the specific reason for the issue.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Hugo
Top achievements
Rank 1
Answers by
Hugo
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or