@@ 353-361 (lines=9) @@ | ||
350 | * |
|
351 | * @return string |
|
352 | */ |
|
353 | public function date($label, $name, array $values, array $errors = [], array $attributes = []) |
|
354 | { |
|
355 | $userFormat = $this->dateParser->getUserDateFormat(); |
|
356 | $values = $this->dateParser->format($values, [$name], $userFormat); |
|
357 | $attributes = array_merge(['placeholder="'.date($userFormat).'"'], $attributes); |
|
358 | ||
359 | return $this->helper->form->label($label, $name). |
|
360 | $this->helper->form->text($name, $values, $errors, $attributes, 'form-date'); |
|
361 | } |
|
362 | ||
363 | /** |
|
364 | * Datetime field. |
|
@@ 374-382 (lines=9) @@ | ||
371 | * |
|
372 | * @return string |
|
373 | */ |
|
374 | public function datetime($label, $name, array $values, array $errors = [], array $attributes = []) |
|
375 | { |
|
376 | $userFormat = $this->dateParser->getUserDateTimeFormat(); |
|
377 | $values = $this->dateParser->format($values, [$name], $userFormat); |
|
378 | $attributes = array_merge(['placeholder="'.date($userFormat).'"'], $attributes); |
|
379 | ||
380 | return $this->helper->form->label($label, $name). |
|
381 | $this->helper->form->text($name, $values, $errors, $attributes, 'form-datetime'); |
|
382 | } |
|
383 | ||
384 | /** |
|
385 | * Display the form error class. |