Explorar o código

ajuste de fecha para visualizarlo en safari(MAC)

Oscar José Nuñez Chávez %!s(int64=5) %!d(string=hai) anos
pai
achega
6b96ed0752
Modificáronse 1 ficheiros con 7 adicións e 20 borrados
  1. 7 20
      src/app/app.component.ts

+ 7 - 20
src/app/app.component.ts

@@ -241,20 +241,7 @@ export class AppComponent implements OnInit {
   ngOnInit() {
     console.log("ng init");
     // Default date is today and set it on a string var and initialize dateRange plugin
-    this.initialDate = this.datepipe.transform(new Date(), "yyyy-MM-dd"); //.toISOString().slice(0, 10);
-    if (this.myDateInit) {
-      let begin: Date = new Date();
-      this.model = {
-        isRange: false,
-        singleDate: {
-          date: {
-            year: begin.getFullYear(),
-            month: begin.getMonth() + 1,
-            day: begin.getDate(),
-          },
-        },
-      };
-    }
+    this.initialDate = "2020-04-20"; //this.datepipe.transform(new Date(), "yyyy-MM-dd"); //.toISOString().slice(0, 10);
 
     // Initialize default 'clicked' options for chart button options
     this.isActive = [
@@ -531,13 +518,13 @@ export class AppComponent implements OnInit {
           .toPromise()
           .then((res: any) => {
             this.totalCertificates = res["data"]["cantidad"];
-            this.lastGeneratedDateCertificate =
-              formatDate(
+            this.lastGeneratedDateCertificate = res["data"]["ultimo_generado"];
+            /*formatDate(
                 res["data"]["ultimo_generado"],
                 "dd/MM/yyyy",
                 "es-Es",
                 "-0600"
-              ) || "N/D";
+              ) || "N/D";*/
             this.totalCertificatesValue = res["data"]["valor_total"];
           });
 
@@ -664,8 +651,8 @@ export class AppComponent implements OnInit {
                 break;
               default:
                 this.barChartLabels = this.metersValues[0]["data"]
-                  .map((obj) =>
-                    formatDate(obj.dateMax, "dd/MM", "es-Es", "-0600")
+                  .map(
+                    (obj) => obj.dateMax //formatDate(obj.dateMax, "dd/MM", "es-Es", "-0600")
                   )
                   .reverse();
             }
@@ -911,7 +898,7 @@ export class AppComponent implements OnInit {
         dateT = formatDate(date, "MM/yyyy", "es-Es", "-0600");
         break;
       default:
-        dateT = formatDate(date, "dd/MM", "es-Es", "-0600");
+        dateT = date; //formatDate(date, "dd/MM", "es-Es", "-0600");
     }
     return dateT;
   }