From f3c09efee2e379189df02a9fabb1517cb481d000 Mon Sep 17 00:00:00 2001 From: Vlad Golubev Date: Fri, 6 Jan 2017 18:24:45 +0200 Subject: [PATCH] Use moment.js to set default yesterday date --- lib/plugins/aws/metrics/awsMetrics.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/plugins/aws/metrics/awsMetrics.js b/lib/plugins/aws/metrics/awsMetrics.js index 6d0e29aa3..8899daf37 100644 --- a/lib/plugins/aws/metrics/awsMetrics.js +++ b/lib/plugins/aws/metrics/awsMetrics.js @@ -33,9 +33,7 @@ class AwsMetrics { this.validate(); const today = new Date(); - let yesterday = new Date(); - yesterday = yesterday.setDate(yesterday.getDate() - 1); - yesterday = new Date(yesterday); + const yesterday = moment().subtract(1, 'day').toDate(); if (this.options.startTime) { const since = (['m', 'h', 'd']