From 3ade5da00fe6a38f727ba1015b9f0df9bc7993a4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 21 Jan 2015 23:10:59 -0500 Subject: [PATCH] groups sorting by creation date --- src/groups.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/groups.js b/src/groups.js index fe44bb367a..0dcb9379a8 100644 --- a/src/groups.js +++ b/src/groups.js @@ -920,6 +920,12 @@ var async = require('async'), }); break; + case 'date': + groups = groups.sort(function(a, b) { + return a.createtime < b.createtime; + }); + break; + case 'alpha': // intentional fall-through default: groups = groups.sort(function(a, b) {