Added release date to selected album info
This commit is contained in:
parent
d98362e55a
commit
24b2cf76bc
@ -19,6 +19,10 @@ class Album extends Eloquent {
|
||||
return $this->hasMany('Fieldprotocol\Music\Song');
|
||||
}
|
||||
|
||||
public function releaseDate() {
|
||||
return date('F jS, Y', strtotime($this->release_date));
|
||||
}
|
||||
|
||||
public function releaseYear() {
|
||||
return date('Y', strtotime($this->release_date));
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
<img id="album-artwork" class="image-responsive album-art" src="{{ albums[0].album_art }}" alt="{{ albums[0].title }}">
|
||||
<div class="caption">
|
||||
<h3 id="album-title">{{ albums[0].title }}</h3>
|
||||
<h4 id="album-release">{{ albums[0].releaseDate }}</h4>
|
||||
{% if albums[0].description %}
|
||||
<hr />
|
||||
<p id="album-description">{{ albums[0].description }}</p>
|
||||
|
@ -24,6 +24,7 @@
|
||||
<img id="album-artwork" class="image-responsive album-art" src="{{ albums[0].album_art }}" alt="{{ albums[0].title }}">
|
||||
<div class="caption">
|
||||
<h3 id="album-title">{{ albums[0].title }}</h3>
|
||||
<h4 id="album-release">{{ albums[0].releaseDate }}</h4>
|
||||
{% if albums[0].description %}
|
||||
<hr />
|
||||
<p id="album-description">{{ albums[0].description }}</p>
|
||||
|
@ -45,6 +45,8 @@ function getAlbumInfo(albumElem) {
|
||||
$('#album-artwork').attr('src', json.album_art);
|
||||
// change album title
|
||||
$('#album-title').text(json.title);
|
||||
// change album release date
|
||||
$('#album-release').text(new Date(json.release_date, "January 25 2015"))
|
||||
// change album description
|
||||
$('#album-description').text(json.description);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user