Skip to content
Snippets Groups Projects
Commit 0bb94e15 authored by Seamus Lee's avatar Seamus Lee
Browse files

[REF] Fix second output in customFormat function and extend unit test

parent ef905d58
Branches
Tags
No related merge requests found
......@@ -369,7 +369,7 @@ class CRM_Utils_Date {
$hour24 = (int) substr($dateString, 11, 2);
$minute = (int) substr($dateString, 14, 2);
$second = (int) substr($dateString, 16, 2);
$second = (int) substr($dateString, 17, 2);
}
else {
$year = (int) substr($dateString, 0, 4);
......
......@@ -270,6 +270,7 @@ class CRM_Utils_DateTest extends CiviUnitTestCase {
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%p"), "pm");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%P"), "PM");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%Y"), "2018");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%s"), "44");
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment