I have an asp.net webpage with a jQuery dump.
I am in the UK, so when I enter 28/02/2010 , I expect him to decide on the 28th Feb 2010 .
This works as expected on my local dev env - but not on our QA or prod-like envs - or on one of the other dev machines. In these cases, it seems that an attempt to resolve it to the American date format does not pass the check, because it is out of range.
It seems that jQuery is generating the correct date every time, which makes me think it might be a database problem.
I am using SQL Server 2005, my collation is Latin1_General_CI_AS , my colleagues are using collation SQL_Latin1_General_CP1_CI_AS and Chinese.
Given that we do not control the installation of prod SQL Server (just our db), what is the best way to do this work in a standard way? Change db options or code that uses it?
Thanks in advance! - L
[EDIT to add code information]
This is my code to call datepicker:
<%=Html.TextBox("DateOfBirth", Model.DateOfBirth.ToShortDateString(), new { @class = "datepicker" })%>
Here is the js for datepicker:
DatePickerSettings = { setup: function () { $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true }); } };
And here is how I indicate the date in the model:
[Required] [DisplayName("Date of Birth")] public virtual DateTime DateOfBirth { get; set; }
The date is displayed correctly in the controller and repository ... until it gets into db.
Thanks:)