From e07d56096d4757f4dcd2b948786a84a6026fa3b5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:51:21 +0000 Subject: [PATCH] BUGFIX Allowing DatetimeField->saveInto() to save a partial array notation with missing 'time' value (from r107441) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112599 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/DatetimeField.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forms/DatetimeField.php b/forms/DatetimeField.php index f5d4c3d09..ce8523005 100644 --- a/forms/DatetimeField.php +++ b/forms/DatetimeField.php @@ -91,8 +91,10 @@ class DatetimeField extends FormField { function dataValue() { $valDate = $this->dateField->dataValue(); $valTime = $this->timeField->dataValue(); - - if($valDate && $valTime) { + + // Only date is actually required, time is optional + if($valDate) { + if(!$valTime) $valTime = '00:00:00'; return $valDate . ' ' . $valTime; } else { // TODO