diff options
author | emkael <emkael@tlen.pl> | 2020-05-05 14:25:42 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-05-05 14:25:42 +0200 |
commit | 62827e6cf470449c117624058fb36ad94804bcc0 (patch) | |
tree | 10cd1e4d36c34b694acfadaa69fc7f6ae2b1eabd /plugins/TimeMachine/Helper/SubTaskTimeTracking.php | |
parent | 7b66ddf2e4fbdb837e78d8b7dbaa9fc38391bc32 (diff) |
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'); + } + +} |