import { Component } from '@angular/core';
import { IonicPage, NavController, LoadingController, ViewController, ModalController, NavParams } from 'ionic-angular';
import { DoctorService } from '../../services/doctor.service';
import { Pata } from '../../pata';
import * as moment from 'moment';

@Component({
  selector: 'page-modal-terms',
  templateUrl: 'modal-terms.html',
})
export class ModalTermsPage {

  obj: any = null;
  load: boolean = false;
  
  constructor(public navCtrl: NavController,
    public viewCtrl: ViewController,
    private docService: DoctorService,
    public service: Pata,
    public loadingCtrl: LoadingController,
    public modalCtrl: ModalController,
    public navParams: NavParams) {
    
      this.obj = this.navParams.get('obj');
      /*
      let load = this.loadingCtrl.create({content: 'cargando...'});
      load.present();
      this.docService.getOrders(id).subscribe((data:any)=>{
        load.dismiss();
        this.load = true;
        this.order = data.data;
      });
      */
    
  }

  accept() {
    this.docService.acceptTerms().subscribe((data:any)=>{});
    this.viewCtrl.dismiss();
  }
  dateformat(fecha) {
    var fecha_mm = moment(fecha);
    return moment(fecha_mm.format(), moment.ISO_8601).format();
  }


}
