diff options
Diffstat (limited to 'plugins/TimeMachine/Helper/SubTaskTimeTracking.php')
-rw-r--r-- | plugins/TimeMachine/Helper/SubTaskTimeTracking.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/TimeMachine/Helper/SubTaskTimeTracking.php b/plugins/TimeMachine/Helper/SubTaskTimeTracking.php new file mode 100644 index 00000000..7197672a --- /dev/null +++ b/plugins/TimeMachine/Helper/SubTaskTimeTracking.php @@ -0,0 +1,38 @@ +<?php + + +namespace Kanboard\Plugin\TimeMachine\Helper; + +use Kanboard\Core\Base; + +/** + * Class SubTaskTimeTracking + * + * @package Kanboard\Plugin\TimeMachine\Helper + * @author yvalentin + */ +class SubTaskTimeTracking extends Base +{ + + /** + * Datetime field + * + * @access public + * @param string $label + * @param string $name + * @param array $values + * @param array $errors + * @param array $attributes + * @return string + */ + public function datetime($label, $name, array $values, array $errors = array(), array $attributes = array()) + { + $userFormat = $this->dateParser->getUserDateTimeFormat(); + $values = $this->dateParser->format($values, array($name), $userFormat); + $attributes = array_merge(array('placeholder="'.date($userFormat).'"'), $attributes); + + return $this->helper->form->label($label, $name) . + $this->helper->form->text($name, $values, $errors, $attributes, 'form-datetime'); + } + +} |