mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 14:37:59 +01:00
Fixed an error with fetching the year and release date.
This commit is contained in:
parent
d86028310e
commit
be0bfa790e
2 changed files with 7 additions and 7 deletions
|
@ -88,4 +88,4 @@
|
|||
'name' => $track->name
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
}
|
||||
|
||||
public function getYearAttribute() {
|
||||
return date('Y', strtotime($this->release_date));
|
||||
return date('Y', strtotime($this->getReleaseDate()));
|
||||
}
|
||||
|
||||
public function setTitleAttribute($value) {
|
||||
|
@ -341,12 +341,12 @@
|
|||
return $this->user->display_name;
|
||||
}
|
||||
|
||||
public function getReleaseDateAttribute() {
|
||||
if($this->attributes['released_at'] !== NULL)
|
||||
return $this->attributes['released_at'];
|
||||
public function getReleaseDate() {
|
||||
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, '');
|
||||
|
|
Loading…
Reference in a new issue