I am using MVC 4 and am wondering if there is a bug in the Datetime culture info?
I am trying to get Australian dates to work (dd/MM/yyyy), but it keeps saying that the date format is wrong, even after puttig a globalizaton to the web.config. I thought it was an error with my code, but even if you start a new project it still happens.
I started a new MVC 4 Web application.
Added the following to the web.config file
<globalization culture="en-AU" uiCulture="en-AU" />
Then I added the following to the AccountModels.cs file:
[DataType(DataType.DateTime)]
[Required(ErrorMessage="Date is required")]
public DateTime? MyDate { get; set; }
Then I added the following to the Register.cshtml file:
<li>
@Html.LabelFor(m => m.MyDate)
@Html.TextBoxFor(m => m.MyDate)
</li>
Run the application, go to the register page, try a date like 26/03/2013 and it says not a valid format.
Please help.