In the edit form in sharepoint designer 2010 I want to use the Sharepoint😀ateTimeControl for my date fields. The problem is whenever I save the edit or insert form and leave these fields blank with this control in place it defaults to todays date. I want it to be an empty string or just left blank.
In my edit form, my date is blank.
But, if I save the form, and the date is blank, it takes today’s date.
If open my form in mode edition
this is my code in sharepoint designer edit form
?width=750?width=750?width=750?width=750
Done a bit of Googling – looks like this is a common problem. the only way around it is to test for empty date.
if (dt.IsDateEmpty)
{
objdt = DBNull.Value;
}
else
{
objdt = dt.SelectedDate.ToString();
}
http://sharepointdata.blogspot.co.uk/2011/02/sharepoint-datetime-control-returning.html