From 6826770acedb820fb1d572d5f6fe02030c52f8bc Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Thu, 10 Sep 2015 11:30:48 +0100 Subject: [PATCH] Merge rPFbe0bfa790ec5: Fixed an error with fetching the year and release date. --- app/Track.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Track.php b/app/Track.php index 71e0fee6..56a73dee 100644 --- a/app/Track.php +++ b/app/Track.php @@ -377,7 +377,7 @@ class Track extends Model public function getYearAttribute() { - return date('Y', strtotime($this->release_date)); + return date('Y', strtotime($this->getReleaseDate())); } public function setTitleAttribute($value) @@ -423,14 +423,14 @@ class Track extends Model return $this->user->display_name; } - public function getReleaseDateAttribute() + public function getReleaseDate() { - if ($this->attributes['released_at'] !== null) { - return $this->attributes['released_at']; + if ($this->released_at !== null) { + return $this->released_at; } - if ($this->attributes['published_at'] !== null) { - return Str::limit($this->attributes['published_at'], 10, ''); + if ($this->published_at !== null) { + return Str::limit($this->published_at, 10, ''); } return Str::limit($this->attributes['created_at'], 10, '');