import { Component, OnInit, Input } from '@angular/core';
import { MiniInfo } from 'src/app/models/Charts/mini-info.model';

import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';

@Component({
  selector: 'app-mini-info',
  templateUrl: './mini-info.component.html',
  styleUrls: ['./mini-info.component.css']
})
export class MiniInfoComponent implements OnInit {
  @Input() info: MiniInfo;
  @Input() loading: boolean = false;
  private months:string[] = ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'];

  constructor() { }

  ngOnInit(): void {

  }

  transformDate() {
    if (!this.info.date) return 'principio'
    return this.info.date.getDate() + ' de ' + this.months[this.info.date.getMonth()];
  }

}
