@@ 146-155 (lines=10) @@ | ||
143 | * |
|
144 | * @return \Spatie\Html\Elements\Input |
|
145 | */ |
|
146 | public function date($name = '', $value = null, $format = true) |
|
147 | { |
|
148 | $element = $this->input('date', $name, $value); |
|
149 | ||
150 | if (! $format || empty($element->getAttribute('value'))) { |
|
151 | return $element; |
|
152 | } |
|
153 | ||
154 | return $element->value($this->formatDateTime($element->getAttribute('value'), self::HTML_DATE_FORMAT)); |
|
155 | } |
|
156 | ||
157 | /** |
|
158 | * @param string|null $name |
|
@@ 181-190 (lines=10) @@ | ||
178 | * |
|
179 | * @return \Spatie\Html\Elements\Input |
|
180 | */ |
|
181 | public function time($name = '', $value = null, $format = true) |
|
182 | { |
|
183 | $element = $this->input('time', $name, $value); |
|
184 | ||
185 | if (! $format || empty($element->getAttribute('value'))) { |
|
186 | return $element; |
|
187 | } |
|
188 | ||
189 | return $element->value($this->formatDateTime($element->getAttribute('value'), self::HTML_TIME_FORMAT)); |
|
190 | } |
|
191 | ||
192 | /** |
|
193 | * @param string $tag |