Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
match with 0.1.38 of datetimepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
highstrike committed Apr 4, 2017
1 parent a5764ed commit 9265887
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/View/Widget/DTPickerWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* echo $this->Form->input('date3', ['type' => 'dtpicker', 'mode' => 'time']);
*
* @author Flavius
* @version 0.2
* @version 0.3
*/
class DTPickerWidget implements WidgetInterface
{
Expand Down Expand Up @@ -88,6 +88,9 @@ public function render(array $data, ContextInterface $context) {
if($mode == 'time')
$hval = $data['value'] = $data['value']->format('H:i:s');

// add field type
$data['data-field'] = $mode;

// render
$rand = Text::uuid();
return "<div id='{$rand}' style='position: relative;'>" . $this->_templates->format('input', [
Expand All @@ -96,7 +99,7 @@ public function render(array $data, ContextInterface $context) {
'attrs' => $this->_templates->formatAttributes(['value' => $hval]),
]) . $this->_templates->format('input', [
'name' => $data['name'] . '-' . $rand,
'type' => $mode,
'type' => 'text',
'templateVars' => $data['templateVars'],
'attrs' => $this->_templates->formatAttributes(
$data,
Expand Down

0 comments on commit 9265887

Please sign in to comment.