From 8d8211b2a5fa997bce06d7ae0c6f7cf37f97b245 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 14 Jul 2020 10:51:45 +0200 Subject: Add machine-readable dates in views (#3106) This will allow to make some transformations on dates when needed. See #3103 and #853 --- app/Models/Entry.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/Models') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 14eacbe78..75d8da12c 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -87,9 +87,11 @@ class FreshRSS_Entry extends Minz_Model { public function date($raw = false) { if ($raw) { return $this->date; - } else { - return timestamptodate($this->date); } + return timestamptodate($this->date); + } + public function machineReadableDate() { + return @date (DATE_ATOM, $this->date); } public function dateAdded($raw = false, $microsecond = false) { if ($raw) { -- cgit v1.2.3