@@ 1298-1302 (lines=5) @@ | ||
1295 | ||
1296 | if ($type === 'time') { |
|
1297 | foreach ($timeFields as $key => $val) { |
|
1298 | if (!isset($data[$val]) || $data[$val] === '0' || $data[$val] === '00') { |
|
1299 | $data[$val] = '00'; |
|
1300 | } elseif ($data[$val] !== '') { |
|
1301 | $data[$val] = sprintf('%02d', $data[$val]); |
|
1302 | } |
|
1303 | ||
1304 | if (!empty($data[$val])) { |
|
1305 | $date[$key] = $data[$val]; |
|
@@ 1315-1319 (lines=5) @@ | ||
1312 | if ($type === 'datetime' || $type === 'timestamp' || $type === 'date') { |
|
1313 | foreach ($dateFields as $key => $val) { |
|
1314 | if ($val === 'hour' || $val === 'min' || $val === 'sec') { |
|
1315 | if (!isset($data[$val]) || $data[$val] === '0' || $data[$val] === '00') { |
|
1316 | $data[$val] = '00'; |
|
1317 | } else { |
|
1318 | $data[$val] = sprintf('%02d', $data[$val]); |
|
1319 | } |
|
1320 | } |
|
1321 | ||
1322 | if (!isset($data[$val]) || isset($data[$val]) && (empty($data[$val]) || $data[$val][0] === '-')) { |