@financial-times/x-live-blog-wrapper
Advanced tools
Comparing version 1.6.7 to 1.6.8
@@ -197,2 +197,16 @@ 'use strict'; | ||
id = _ref.id; | ||
posts.sort(function (a, b) { | ||
var timestampA = a.publishedDate || a.publishedTimestamp; | ||
var timestampB = b.publishedDate || b.publishedTimestamp; // Newer posts on top | ||
if (timestampA > timestampB) { | ||
return -1; | ||
} | ||
if (timestampB > timestampA) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
var postElements = posts.map(function (post) { | ||
@@ -199,0 +213,0 @@ return xEngine.h(xLiveBlogPost.LiveBlogPost, Object.assign({ |
@@ -197,2 +197,16 @@ 'use strict'; | ||
id = _ref.id; | ||
posts.sort(function (a, b) { | ||
var timestampA = a.publishedDate || a.publishedTimestamp; | ||
var timestampB = b.publishedDate || b.publishedTimestamp; // Newer posts on top | ||
if (timestampA > timestampB) { | ||
return -1; | ||
} | ||
if (timestampB > timestampA) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
var postElements = posts.map(function (post) { | ||
@@ -199,0 +213,0 @@ return xEngine.h(xLiveBlogPost.LiveBlogPost, Object.assign({ |
@@ -193,2 +193,16 @@ import { h } from '@financial-times/x-engine'; | ||
id = _ref.id; | ||
posts.sort(function (a, b) { | ||
var timestampA = a.publishedDate || a.publishedTimestamp; | ||
var timestampB = b.publishedDate || b.publishedTimestamp; // Newer posts on top | ||
if (timestampA > timestampB) { | ||
return -1; | ||
} | ||
if (timestampB > timestampA) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
var postElements = posts.map(function (post) { | ||
@@ -195,0 +209,0 @@ return h(LiveBlogPost, Object.assign({ |
{ | ||
"name": "@financial-times/x-live-blog-wrapper", | ||
"version": "1.6.7", | ||
"version": "1.6.8", | ||
"description": "", | ||
@@ -18,5 +18,5 @@ "main": "dist/LiveBlogWrapper.cjs.js", | ||
"dependencies": { | ||
"@financial-times/x-engine": "^1.6.7", | ||
"@financial-times/x-live-blog-post": "^1.6.7", | ||
"@financial-times/x-interaction": "^1.6.7" | ||
"@financial-times/x-engine": "^1.6.8", | ||
"@financial-times/x-live-blog-post": "^1.6.8", | ||
"@financial-times/x-interaction": "^1.6.8" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
32359
630