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

Localization and date instead of datetime inside a grid

1 Answer 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maurice
Top achievements
Rank 1
Veteran
Maurice asked on 10 Oct 2016, 06:59 AM

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

 

 

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 11 Oct 2016, 02:46 PM
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
Tags
Grid
Asked by
Maurice
Top achievements
Rank 1
Veteran
Answers by
Konstantin Dikov
Telerik team
Share this question
or