From 86dd2096871b0c73b635bf516e035b13511af2bc Mon Sep 17 00:00:00 2001
From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com>
Date: Fri, 27 Nov 2020 15:26:46 +0100
Subject: [PATCH] change cleaning condition

---
 src/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/index.js b/src/index.js
index 6b67c23..37b0e24 100755
--- a/src/index.js
+++ b/src/index.js
@@ -133,7 +133,7 @@ async function getData(token, idPCE) {
  * Return the list of daily data
  */
 async function cleanOldData() {
-  if(moment().isAfter("2020-12-02")){
+  if(moment().diff(moment("2020-12-02", "DD/MM/YYYY")) > 0){
     log('debug', 'No cleaning to do')
     return false
   } else {
-- 
GitLab