Skip to content
Snippets Groups Projects
Commit 110eeb34 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

#2325 Fix handling of seconds on import

This addresses an issue where the following date time has the time component
stripped

2012-12-12 07:12:56

Without the seconds - ie

2012-12-12 07:12

Note that I do have a test in a PR for the import where
parent ed4c0b29
Branches
Tags
No related merge requests found
......@@ -2125,7 +2125,7 @@ class CRM_Utils_Date {
$ruleName = 'date';
if ($dateType == 1) {
$matches = [];
if (preg_match("/(\s(([01]\d)|[2][0-3]):([0-5]\d))$/", $date, $matches)) {
if (preg_match("/(\s(([01]\d)|[2][0-3]):([0-5]\d):?[0-5]?\d?)$/", $date, $matches)) {
$ruleName = 'dateTime';
if (strpos($date, '-') !== FALSE) {
$dateVal .= array_shift($matches);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment