silverstripe/sapphire — pull request #272 by halkyon (2012-03-27 01:47:36+00:00)
Title: Setting null day/month/year values with dmyfields option gives erroneous values back in valueObj

If you call setValue(array('day' => '', 'month' => '', 'year' => '')) on a DateField, the valueObj property gets set with Zend_Date data that is erroneous. This stops you from actually submitting a form with empty day, month and year values, as Zend_Date will give back 2000-11-1 (?), which is an erroneous date.

I've written a test to confirm that dataValue() is null if you submit empty day, month and year values in the value array, and fixed the appropriate place which attempts to use Zend_Date on the value set on DateField.