From 2a8128872d91c17eb6c07ebb0b2d0eb99570da3a Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 8 Oct 2014 17:36:54 -0600 Subject: [PATCH] fix(moment): fix deprecated warnings, use updated moment syntax --- src/controllers/payments.js | 2 +- src/controllers/user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/payments.js b/src/controllers/payments.js index ad69489be4..ec0da30ab0 100644 --- a/src/controllers/payments.js +++ b/src/controllers/payments.js @@ -108,7 +108,7 @@ function cancelSubscription(user, data){ if(isProduction) emailUser(user, 'cancel-subscription'); user.purchased.plan.dateTerminated = moment( now.format('MM') + '/' + moment(du).format('DD') + '/' + now.format('YYYY') ) - .add(1, 'month') + .add({months:1}) .toDate(); ga.event('unsubscribe', 'Stripe').send(); diff --git a/src/controllers/user.js b/src/controllers/user.js index fe610e4f9a..e2e7ec6b38 100644 --- a/src/controllers/user.js +++ b/src/controllers/user.js @@ -477,7 +477,7 @@ api.batchUpdate = function(req, res, next) { }else if(response.wasModified){ // Preen 3-day past-completed To-Dos from Angular & mobile app response.todos = _.where(response.todos, function(t) { - return !t.completed || (t.challenge && t.challenge.id) || moment(t.dateCompleted).isAfter(moment().subtract('days',3)); + return !t.completed || (t.challenge && t.challenge.id) || moment(t.dateCompleted).isAfter(moment().subtract({days:3})); }); res.json(200, response);