Ionic calendar array,api


#1

Hi, How can I display my sample array date to ionic full calendar?

home.ts

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  eventSource = [
    {"title":"fuck",
    "start":"2018-05-10 11:00:00",
    "end":"2018-05-10 12:00:00"
    },
    {"title":"tae",
    "startTime":"2018-06-10 11:00:00",
    "endTime":"2018-06-10 12:00:00",
    "color":"#1f1f1"}
  ];


  viewTitle: string;
  selectedDay = new Date();

  calendar = {
    mode: 'month',
    currentDate: this.selectedDay
  }
  constructor(public navCtrl: NavController) {
  
  }

  onViewTitleChanged(title) {
    this.viewTitle = title;
  }

  onTimeSelected(ev) {
    this.selectedDay = ev.selectedTime;
  }

  onEventSelected(event) {

  }

}

home.html

<ion-header>
  <ion-navbar>
    <ion-title>
      {{ viewTitle }}
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content>
  <calendar [eventSource]="eventSource"
  [calendarMode]="calendar.mode"
  [currentDate]="calendar.currentDate"
  (onEventSelected)="onEventSelected($event)"
  (onTitleChanged)="onViewTitleChanged($event)"
  (onTimeSelected)="onTimeSelected($event)"
  step="30"
  class="calendar"
  >

  </calendar>
</ion-content>