This project is read-only.


DateTime field fails silently if no time is specified


If a DateTime field is set to store date and time then when trying to save an item having only the date part specified makes storage of the field silently fail. The item is seemingly saved and no warning is displayed but the value of the date is not saved. More precisely: DateTime.MinValue is stored.
I'd prefer to warn the user or even better save the date part and use a default for time (e.g. 0:00).
If the time is specified but not the date I'd definitely go with a warning.
Closed Sep 18, 2014 at 11:41 PM by sebastienros


Jetski5822 wrote May 17, 2014 at 4:27 PM

I am having a hard time trying to repro this.

I have tried to same with nothing specified, and It doesnt fail.
I have tried with just the Date specified, and it gets set here..


Line 142: var localTime = !String.IsNullOrWhiteSpace(timeString) ? DateTime.Parse(timeString, cultureInfo) : new DateTime(1980, 1, 1, 12, 0, 0);

Any ideas?