mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Merge rPFbe0bfa790ec5: Fixed an error with fetching the year and release date.
This commit is contained in:
parent
85586c17de
commit
6826770ace
1 changed files with 6 additions and 6 deletions
|
@ -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, '');
|
||||
|
|
Loading…
Reference in a new issue