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

[Solved] How can I use culture(Date/Time format) settings in date picker control?

2 Answers 102 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Libin
Top achievements
Rank 2
Libin asked on 20 Jan 2011, 07:54 AM
I am developing a MVC 2 web application and the view contains two date pickers with start and end date.
The problem is like I want them show dd/MM/yyyy format.
I have put the code

<%

 

= Html.Telerik().DatePicker().Name("Detail.StartDate").Value(DateTime.Now).MinDate(DateTime.Now.Subtract(new TimeSpan(0, 1, 0))).Format("dd/MM/yyyy")%>

 

<%

 

= Html.ValidationMessageFor(model => model.Detail.StartDate)%>

 


and

<%

 

= Html.Telerik().DatePicker().Name("Detail.EndDate").Value(DateTime.Now).MinDate(DateTime.Now.Subtract(new TimeSpan(0, 1, 0))).Format("dd/MM/yyyy")%>

 

<%

 

= Html.ValidationMessageFor(model => model.Detail.EndDate)%>

 


but showing invalid date error validation message which i have set.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Jan 2011, 09:52 AM
Hello Libin,

I have tried to reproduce this issue on my end, bu to no avail.

In other to continue with our investigation could you please try to change DatePicker UI component with regular Html.TextBox and set its value to a date with "dd/MM/yyyy" format? 

If the problem exists only with our component, I will ask you to send us a simple test project which reproduces the depicted issue.

Regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Libin
Top achievements
Rank 2
answered on 20 Jan 2011, 12:06 PM
Hi Guys,
 the issue that I was after  got solved,It was figured out that if we specify the code

[DisplayFormat(DataFormatString = "{0:u}")]

in the model along with the data type can save the situation!!

Thanks for the reply man!!
God bless you guys!!

Libin :)
Tags
Date/Time Pickers
Asked by
Libin
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Libin
Top achievements
Rank 2
Share this question
or