Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: display video publication date in info box
/* ... */
import {getPublishedAtDateString} from '../../services/date/date-format';
export class VideoInfoBox extends React.Component {
/* ... */
render() {
/* ... */
const publishedAtString = getPublishedAtDateString(this.props.video.snippet.publishedAt);
return (
<div>
{/* ... */}
<div className="video-info">
<div className='channel-name'>Channel Name</div>
<div className='video-publication-date'>{publishedAtString}</div>
</div>
{/* ... */}
</div>
<Divider/>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.