Переглянути джерело

Minor changes to dates. Remove console logs.

Lee Morgan 6 роки тому
батько
коміт
604a7091ae
2 змінених файлів з 3 додано та 5 видалено
  1. 3 1
      views/dataPage/fetchData.js
  2. 0 4
      views/shared/graphs.js

+ 3 - 1
views/dataPage/fetchData.js

@@ -1,5 +1,5 @@
 let date = new Date();
-let yearAgo = new Date(date.getFullYear() - 1, date.getMonth(), date.getDate());
+let yearAgo = new Date(new Date().setFullYear(date.getFullYear() - 1));
 
 let onDataLoad = function(){
     let dateSort = document.querySelector("#dateSort");
@@ -11,6 +11,8 @@ axios.post("/transactions", {from: yearAgo, to: date})
     .then((response)=>{
         if(typeof(response.data) === "string"){
             banner.createError(response.data);
+
+            
         }else{
             data.transactions = response.data;
             onDataLoad();

+ 0 - 4
views/shared/graphs.js

@@ -17,8 +17,6 @@ class LineGraph{
         this.verticalMultiplier = (this.bottom - this.top) / max;
         this.horizontalMultiplier = (this.right - this.left) / data.length;
 
-        console.log(data);
-
         xData.dataLength = data.length;
 
         this.drawYAxis(yName, max);
@@ -71,8 +69,6 @@ class LineGraph{
                 this.context.stroke();
 
                 showDate.setDate(showDate.getDate() + Math.abs(diff / 10));
-
-                console.log(i);
             }
 
             // do{