mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-02 12:39:25 +01:00
feat(forums): test server moment
This commit is contained in:
@@ -71,25 +71,25 @@ exports.list = function (req, res) {
|
||||
};
|
||||
|
||||
var forumsRepliesCount = function (callback) {
|
||||
var nd = (new Date()).getDate();
|
||||
console.log(moment());
|
||||
console.log(moment.utc());
|
||||
console.log(moment().year(year).month(month).date(day));
|
||||
console.log(moment.utc().year(year).month(month).date(day));
|
||||
Topic.aggregate({
|
||||
$unwind: '$_replies'
|
||||
}, {
|
||||
$project: {
|
||||
'forum': '$forum',
|
||||
'title': '$title',
|
||||
'createdAt': '$_replies.createdAt',
|
||||
//'title': '$title',
|
||||
//'createdAt': '$_replies.createdAt',
|
||||
'day': {
|
||||
'$dayOfMonth': '$_replies.createdAt'
|
||||
},
|
||||
'mday': {
|
||||
'$dayOfMonth': moment('$_replies.createdAt')
|
||||
},
|
||||
'nd': nd
|
||||
}
|
||||
}
|
||||
}, {
|
||||
$match: {
|
||||
day: moment.utc().date()
|
||||
}
|
||||
}, {
|
||||
$group: {
|
||||
_id: '$forum',
|
||||
count: {$sum: 1}
|
||||
}
|
||||
}).exec(function (err, counts) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user