Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zooniverse/Panoptes-Front-End
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2df7dd7be78a34c1970e63954879f02ba0d6cc9a
Choose a base ref
..
head repository: zooniverse/Panoptes-Front-End
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 431b94709e0b7833ad0334f0d0a1e19ac79225dd
Choose a head ref
Showing with 185 additions and 183 deletions.
  1. +4 −2 app/lib/get-social-data.js
  2. +1 −1 app/pages/home-common/social.jsx
  3. +173 −173 package-lock.json
  4. +7 −7 package.json
6 changes: 4 additions & 2 deletions app/lib/get-social-data.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ function parseFeedPost(post) {
id: post.ID,
title: removeEntities(post.title),
excerpt: removeEntities(post.excerpt),
created_at: post.date,
created_at: new Date(post.date),
link: post.URL,
image: post.featured_image
};
@@ -59,7 +59,9 @@ async function getBlogPosts() {
feeds.forEach(feed => {
posts = posts.concat(feed.slice(0,3))
});
return posts.map(parseFeedPost);
return posts
.map(parseFeedPost)
.sort((a,b) => b.created_at - a.created_at);
} catch (error) {
console.error(error);
}
2 changes: 1 addition & 1 deletion app/pages/home-common/social.jsx
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ export default class HomePageSocial extends React.Component {
'home-social__blog-section--white': i === 0,
'home-social__blog-section--gray': i !== 0
});
const timestamp = moment(new Date(post.created_at)).fromNow();
const timestamp = moment(post.created_at).fromNow();
return (
<div key={i} className={classes}>
{i !== 0 && (<hr />)}
Loading