diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-06-29 12:38:30 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-06-29 12:38:30 +0300 |
| commit | 162922aae001ede41c8fd24d782313e9083d6938 (patch) | |
| tree | a2f7d521adf7cbd8ba41020baf04b0c40e2639f3 /client | |
| parent | 596f8ffc13c31aaf13085680fa60d724c30a1978 (diff) | |
Ascending photo order
Diffstat (limited to 'client')
| -rw-r--r-- | client/button.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/button.js b/client/button.js index bda2afc..4c5eafa 100644 --- a/client/button.js +++ b/client/button.js @@ -142,7 +142,10 @@ Template.dates.events({ Meteor.call('getInstagramMedia', +year, +month, function(error, results) { console.log('Instagram response', results.data); if (results.data.data.length > 0) { - Session.set('photos', results.data.data); + var photos = _.sortBy(results.data.data, function(p) { + return p.created_time; + }); + Session.set('photos', photos); $('form.dates div.error').hide(); $('form.dates button.dates').show(); } |
