From eacada39826769d3515ec97575ff2fb27a37a490 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 9 Jul 2017 18:31:03 -0400 Subject: [PATCH] Fix ISO 8601 format strings --- lib/Misc/DateFormatter.php | 4 ++-- tests/lib/AbstractTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Misc/DateFormatter.php b/lib/Misc/DateFormatter.php index 08ec0f6e..0c680946 100644 --- a/lib/Misc/DateFormatter.php +++ b/lib/Misc/DateFormatter.php @@ -11,7 +11,7 @@ trait DateFormatter { if($outFormat=="unix") return $date->getTimestamp(); switch ($outFormat) { case 'http': $f = "D, d M Y H:i:s \G\M\T"; break; - case 'iso8601': $f = "Y-m-dTH:i:s"; break; + case 'iso8601': $f = "Y-m-d\TH:i:s"; break; case 'sql': $f = "Y-m-d H:i:s"; break; case 'date': $f = "Y-m-d"; break; case 'time': $f = "H:i:s"; break; @@ -34,7 +34,7 @@ trait DateFormatter { if(!is_null($inFormat)) { switch($inFormat) { case 'http': $f = "D, d M Y H:i:s \G\M\T"; break; - case 'iso8601': $f = "Y-m-dTH:i:sP"; break; + case 'iso8601': $f = "Y-m-d\TH:i:sP"; break; case 'sql': $f = "Y-m-d H:i:s"; break; case 'date': $f = "Y-m-d"; break; case 'time': $f = "H:i:s"; break; diff --git a/tests/lib/AbstractTest.php b/tests/lib/AbstractTest.php index b234ee10..efae8e2d 100644 --- a/tests/lib/AbstractTest.php +++ b/tests/lib/AbstractTest.php @@ -25,8 +25,8 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase { } function assertTime($exp, $test) { - $exp = $this->dateTransform($exp, "unix"); - $test = $this->dateTransform($test, "unix"); + $exp = $this->dateTransform($exp, "iso8601"); + $test = $this->dateTransform($test, "iso8601"); $this->assertSame($exp, $test); }