Localization and date instead of datetime inside a grid

2 posts, 0 answers
  1. Maurice
    Maurice avatar
    12 posts
    Member since:
    Jan 2016

    Posted 10 Oct Link to this post

    Hi,

    I have a problem with a datetime in a grid.

    It works like it should if date StartDate doesn't have a DateType. And gets a date and a timepicker in the grid.

    If I change this to 

    [DataType(DataType.Date)]
    public DateTime StartDate { get; set; }

    I will get only the datepicker and not the timepicker.

    But if I fill in the date I get "the field startdate must be a date" See attached picture

    Maybe this is because of the locatlization? I have no clue at the moment.

     

    To get a localization for all my webpages I have put inside the _Layout.cshtml the following

    @{
        string culture = System.Globalization.CultureInfo.CurrentCulture.ToString();
    }
        <script src="@Url.Content("~/Scripts/cultures/kendo.culture." + culture + ".min.js")"></script>
        <script>
            kendo.culture("@culture");
        </script>
    </head>
    <body>

    I can see this becomes

    <script src="/Scripts/cultures/kendo.culture.nl-NL.min.js"></script>
     
    <script>
        kendo.culture("nl-NL");
    </script>

     

     

    Thanks for your support

    Maurice

     

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1796 posts

    Posted 11 Oct Link to this post

    Hello Maurice,

    Could you please ensure that the cultures on client-side and server-side are the same? You can also go through the steps listed in the following help article and see if you have implemented all of them:
    Looking forward to your reply with the results.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top