Using moment.js for publish date

This commit is contained in:
Josef Citrine 2016-11-09 22:31:23 +00:00
parent d67ff0b888
commit 2cb093c78b
3 changed files with 12256 additions and 1663 deletions

View file

@ -17,7 +17,7 @@
</div> </div>
<ul class="stats"> <ul class="stats">
<li>Published: <strong>{{::track.published_at}}</strong></li> <li>Published: <strong>{{formatPublishedDate(track)}}</strong></li>
<li>Views: <strong>{{::track.stats.views}}</strong></li> <li>Views: <strong>{{::track.stats.views}}</strong></li>
<li>Plays: <strong>{{::track.stats.plays}}</strong></li> <li>Plays: <strong>{{::track.stats.plays}}</strong></li>
<li>Downloads: <strong>{{::track.stats.downloads}}</strong></li> <li>Downloads: <strong>{{::track.stats.downloads}}</strong></li>

View file

@ -23,4 +23,8 @@ window.pfm.preloaders['track-show'] = [
module.exports = angular.module('ponyfm').controller "track-show", [ module.exports = angular.module('ponyfm').controller "track-show", [
'$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$modal' '$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$modal'
($scope, tracks, $state, playlists, auth, favourites, $modal) -> ($scope, tracks, $state, playlists, auth, favourites, $modal) ->
$scope.formatPublishedDate = (track) ->
locale = window.navigator.userLanguage || window.navigator.language
moment.locale(locale)
return moment(track.published_at).format('LLL')
] ]

File diff suppressed because it is too large Load diff