26 lines
824 B
PHP
26 lines
824 B
PHP
<?
|
|
|
|
namespace ui\input;
|
|
|
|
|
|
class Date extends Input {
|
|
public function render(array $opt = array()): string {
|
|
$value = $this->value;
|
|
if($value=='0000-00-00') $value = '';
|
|
|
|
if(file_exists($file = dirname(__FILE__).'/views/'.$this->theme.'.php')) {
|
|
ob_start();include($file);return ob_get_clean();
|
|
} else {
|
|
$format_value = $value ? date('d.m.Y', strtotime($value)) : '';
|
|
return '<div class="form-group">
|
|
<label>' . $this->label . '</label>
|
|
<input type="text" class="form-control pickadate" name="' . $this->name . '"
|
|
autocomplete="off"
|
|
data-value="' . $format_value . '"
|
|
value="' . $format_value . '"
|
|
placeholder="' . $this->options[Input::PLACEHOLDER] . '">
|
|
</div>';
|
|
}
|
|
}
|
|
}
|