|
@@ -12,7 +12,7 @@ import { MatSort } from '@angular/material/sort';
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
import Swal from 'sweetalert2';
|
|
import Swal from 'sweetalert2';
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
-import { formatDate } from '@angular/common';
|
|
|
|
|
|
|
+import { formatDate, DatePipe } from '@angular/common';
|
|
|
|
|
|
|
|
import {AngularMyDatePickerDirective,IAngularMyDpOptions, IMyDateModel} from 'angular-mydatepicker';
|
|
import {AngularMyDatePickerDirective,IAngularMyDpOptions, IMyDateModel} from 'angular-mydatepicker';
|
|
|
import printJS from 'print-js'
|
|
import printJS from 'print-js'
|
|
@@ -103,7 +103,8 @@ export class AssetsComponent implements OnInit {
|
|
|
private plantsService: PlantsService,
|
|
private plantsService: PlantsService,
|
|
|
private http: HttpClient,
|
|
private http: HttpClient,
|
|
|
private logsService: LogsService,
|
|
private logsService: LogsService,
|
|
|
- private measService: MeasuresService) {
|
|
|
|
|
|
|
+ private measService: MeasuresService,
|
|
|
|
|
+ public datepipe: DatePipe) {
|
|
|
|
|
|
|
|
this.route.queryParams.subscribe(params => {
|
|
this.route.queryParams.subscribe(params => {
|
|
|
this.organizationId = params['id'];
|
|
this.organizationId = params['id'];
|
|
@@ -119,7 +120,7 @@ export class AssetsComponent implements OnInit {
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
ngOnInit() {
|
|
|
// Default date is today and set it on a string var and initialize dateRange plugin
|
|
// Default date is today and set it on a string var and initialize dateRange plugin
|
|
|
- this.initialDate = new Date().toISOString().slice(0, 10);
|
|
|
|
|
|
|
+ this.initialDate = this.datepipe.transform(new Date(), 'yyyy-MM-dd')//.toISOString().slice(0, 10);
|
|
|
if (this.myDateInit) {
|
|
if (this.myDateInit) {
|
|
|
let begin: Date = new Date();
|
|
let begin: Date = new Date();
|
|
|
this.model = {
|
|
this.model = {
|