From 633076d7c9275b33b722d9a7989e63839f8c38d2 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 22 Mar 2020 16:55:06 +0100 Subject: media date display --- app/class/Page.php | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'app/class/Page.php') diff --git a/app/class/Page.php b/app/class/Page.php index d5b43b5..cf73e98 100644 --- a/app/class/Page.php +++ b/app/class/Page.php @@ -810,35 +810,6 @@ class Page extends Dbitem return $taglist; } - /** - * Tool for accessing different view of the same DateTimeImmutable var - * - * @param string $property DateTimeImmutable var to access - * @param string $option - * - * @return mixed string or false if propriety does not exist - */ - private function datetransform(string $property, string $option = 'date') - { - if(property_exists($this, $property)) { - if ($option == 'string') { - return $this->$property->format(DateTime::ISO8601); - } elseif ($option == 'date' || $option == 'sort') { - return $this->$property; - } elseif ($option == 'hrdi') { - $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); - return hrdi($this->$property->diff($now)); - } elseif ($option == 'pdate') { - return $this->$property->format('Y-m-d'); - } elseif ($option == 'ptime') { - return $this->$property->format('H:i'); - } elseif ($option = 'dmy') { - return $this->$property->format('d/m/Y'); - } - } else { - return false; - } - } } -- cgit v1.2.3