summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/HubView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-01-20 01:33:37 +0100
committerJules Laplace <jules@okfoc.us>2016-01-20 01:33:37 +0100
commit39780c6c2d5474e2af12661935f986265c0feb0d (patch)
tree12998b2bd8a34a9ff83467ac76f755b072179d21 /StoneIsland/www/js/lib/blogs/HubView.js
parentfcdef34b27e8f8e674361cbae17e627b9135d9c7 (diff)
parent75aacfbbf0aaea5f09809428bdebe6842d36f082 (diff)
home screen degrees in N S E W..
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/HubView.js')
-rwxr-xr-xStoneIsland/www/js/lib/blogs/HubView.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js
index dae7f98d..4ed05bb8 100755
--- a/StoneIsland/www/js/lib/blogs/HubView.js
+++ b/StoneIsland/www/js/lib/blogs/HubView.js
@@ -25,13 +25,22 @@ var HubView = ScrollableView.extend({
galleries: {},
populate: function(data){
- this.data = data
+ // sort posts by date, reversed
+ this.data = data.map(function(s){
+ return [ +moment(s.date), s ]
+ }).sort(function(a,b){
+ return a[0] > b[0] ? -1 : a[0] == b[0] ? 0 : 1
+ }).map(function(pair){
+ console.log(pair[1])
+ return pair[1]
+ })
this.$loader.hide()
this.$content.empty()
this.galleries = {}
// id date subtitle body link store image[uri caption]
this.data.forEach(function(row){
// console.log(row)
+ console.log(moment(row.date))
var t = this.template.replace(/{{id}}/g, row.id)
.replace(/{{date}}/, moment(row.date).format("MM.DD.YYYY"))
.replace(/{{title}}/, row.title)