Fix validation of durations

This commit is contained in:
Nathan Gray 2013-02-06 14:36:24 +00:00
parent 3d50a2bc4b
commit 868614fd23

View File

@ -79,10 +79,15 @@ class etemplate_widget_date extends etemplate_widget_transformer
{ {
self::set_validation_error($form_name,lang('Field must not be empty !!!')); self::set_validation_error($form_name,lang('Field must not be empty !!!'));
} }
elseif ($this->type == 'date-duration')
{
$valid = $value;
}
elseif (empty($this->attrs['dataformat'])) // integer timestamp elseif (empty($this->attrs['dataformat'])) // integer timestamp
{ {
$valid = (int)$value; $valid = (int)$value;
} }
// string with formatting letters like for php's date() method // string with formatting letters like for php's date() method
elseif (($valid = date($this->attrs['dataformat'], $value))) elseif (($valid = date($this->attrs['dataformat'], $value)))
{ {