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

3 posts, 0 answers
  1. Hugo
    Hugo avatar
    2 posts
    Member since:
    Sep 2012

    Posted 21 Feb Link to this post

    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. Hugo
    Hugo avatar
    2 posts
    Member since:
    Sep 2012

    Posted 21 Feb Link to this post

    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, 

     

  3. Stefan
    Admin
    Stefan avatar
    1405 posts

    Posted 23 Feb Link to this post

    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 visualization (charts) and form elements.
Back to Top