mirror of
https://github.com/status-im/status-media.git
synced 2025-02-22 08:08:08 +00:00
fix a bug with date, duration
This commit is contained in:
parent
542e0c3a2f
commit
9ffa46dfeb
@ -11,6 +11,7 @@ let parser = new Parser({
|
||||
maxRedirects: 100,
|
||||
customFields: {
|
||||
feed: ['description', 'description'],
|
||||
feed: ['pubDate', 'pubDate'],
|
||||
}
|
||||
});
|
||||
|
||||
@ -33,6 +34,7 @@ export const fetchPodcast = url => dispatch => {
|
||||
const episodes = feed.items
|
||||
const description = feed.description
|
||||
const img = feed.image
|
||||
const pubDate = feed.pubDate
|
||||
|
||||
if (website.substring(0,3) === 'www') {
|
||||
website = 'https://' + website;
|
||||
@ -47,7 +49,8 @@ export const fetchPodcast = url => dispatch => {
|
||||
author,
|
||||
website,
|
||||
episodes,
|
||||
description
|
||||
description,
|
||||
pubDate
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ class EpisodeList extends Component {
|
||||
theme={theme}
|
||||
title={e.title}
|
||||
trackId={e.guid}
|
||||
date={e.published}
|
||||
duration={e.duration}
|
||||
date={e.pubDate}
|
||||
duration={e.itunes.duration}
|
||||
audio={e.enclosure.url}
|
||||
description={e.description}
|
||||
setEpisode={this.setEpisode}
|
||||
|
@ -38,7 +38,7 @@ class EpisodeListElement extends Component {
|
||||
const now = moment()
|
||||
const releaseDate = moment(date)
|
||||
|
||||
return now.diff(releaseDate, 'days') > 14
|
||||
return now.diff(releaseDate, 'days') > 5
|
||||
? moment(date).format('LL')
|
||||
: moment(date).fromNow()
|
||||
}
|
||||
@ -46,7 +46,7 @@ class EpisodeListElement extends Component {
|
||||
render() {
|
||||
const { date, title, theme, trackId, duration, nowPlayingId } = this.props
|
||||
const isPlaying = trackId === nowPlayingId
|
||||
|
||||
|
||||
const minutesLong = Math.round(
|
||||
moment.duration(duration, 'seconds').asMinutes()
|
||||
)
|
||||
|
@ -44,7 +44,6 @@ button {
|
||||
}
|
||||
|
||||
.error {
|
||||
z-index: 9999;
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left: 50%;
|
||||
|
Loading…
x
Reference in New Issue
Block a user