Permalink
Browse files

BUGFIX Allowing DatetimeField->saveInto() to save a partial array not…

…ation with missing 'time' value (from r107441)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112599 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 52bd0cc commit e07d56096d4757f4dcd2b948786a84a6026fa3b5 @chillu chillu committed Oct 15, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 forms/DatetimeField.php
View
6 forms/DatetimeField.php
@@ -91,8 +91,10 @@ function setValue($val) {
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

0 comments on commit e07d560

Please sign in to comment.