aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/DataFieldTimeEntry.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/classes/DataFieldTimeEntry.class.php')
-rw-r--r--lib/classes/DataFieldTimeEntry.class.php30
1 files changed, 7 insertions, 23 deletions
diff --git a/lib/classes/DataFieldTimeEntry.class.php b/lib/classes/DataFieldTimeEntry.class.php
index 96e5835..2e62c49 100644
--- a/lib/classes/DataFieldTimeEntry.class.php
+++ b/lib/classes/DataFieldTimeEntry.class.php
@@ -13,35 +13,19 @@ class DataFieldTimeEntry extends DataFieldEntry
protected $template = 'time.php';
/**
- * Sets the value from a post request
- *
- * @param mixed $submitted_value The value from request
- */
- public function setValueFromSubmit($value)
- {
- if ($value) {
- parent::setValueFromSubmit($value);
- }
- }
-
- /**
- * Checks if the datafield is empty (was not set)
- *
- * @return bool true if empty, else false
- */
- public function isEmpty()
- {
- return $this->getValue() == ':';
- }
-
- /**
* Returns whether the datafield contents are valid
*
* @return boolean indicating whether the datafield contents are valid
*/
public function isValid()
{
- $parts = explode(':', $this->value);
+ $value = trim($this->value);
+
+ if (!$value) {
+ return parent::isValid();
+ }
+
+ $parts = explode(':', $value);
return parent::isValid()
&& $parts[0] >= 0 && $parts[0] <= 24