concrete5/concrete5 — pull request #628 by Remo (2012-08-24 10:05:20+00:00)
Title: allow null values in date time helper

the datetime attributes tries to save null values in case there's no value.
```php
public function saveValue($value) {
if ($value != '') {
$value = date('Y-m-d H:i:s', strtotime($value));
} else {
$value = null;
}

$db = Loader::db();
$db->Replace('atDateTime', array('avID' => $this->getAttributeValueID(), 'value' => $value), 'avID', true);
}
```
however, saveValue is called by saveForm which has this code in it:
```php
$dt = Loader::helper('form/date_time');
$value = $dt->translate('value', $data);
```
the translate method always tries to convert the value to a date, if if it's empty. This results in 1/1/1970
The date method in the helper also check for empty values with this === '' but when there's no date, it's not a string and therefore shows the current date. If we don't check the data type and only the value, the date_time attribute allows us to save and display empty dates.