Skip to content

Commit 3289d97

Browse files
committed
DateTimeInput: fixed missing seconds from HTML input
1 parent 859e088 commit 3289d97

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/DateTimeInput.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ public function loadHttpData()
107107

108108
$m = Strings::match($value, '#^(?P<yyyy>\d{4})-(?P<mm>\d{2})-(?P<dd>\d{2})T(?P<hh>\d{2}):(?P<ii>\d{2}):(?P<ss>\d{2})#');
109109

110+
if (!is_array($m)) {
111+
$m = Strings::match($value, '#^(?P<yyyy>\d{4})-(?P<mm>\d{2})-(?P<dd>\d{2})T(?P<hh>\d{2}):(?P<ii>\d{2})#');
112+
113+
if (is_array($m)) {
114+
$m['ss'] = '00';
115+
}
116+
}
117+
110118
if (is_array($m)) {
111119
$yyyy = $m['yyyy'];
112120
$mm = $m['mm'];

0 commit comments

Comments
 (0)