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