twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

load event from json data #168

Open abdulkadhir opened 6 years ago

abdulkadhir commented 6 years ago

hi, I want to load events on the calendar which is in JSON format. my JSON data is `

[ { "event_title": "Holiday", "event_description": "Holiday", "event_type": "Holiday", "start_time": "2017-12-15", "end_time": "2017-12-15" }, { "event_title": "Holiday", "event_description": "Holiday", "event_type": "Holiday", "start_time": "2017-12-12", "end_time": "2017-12-12" } ]`

I'm new to ionic and I struck with this can you help me with this? thanks in advance

twinssbc commented 6 years ago

@abdulkadhir You need to convert your json format data to the format the calendar can recognize. Take a look at the EventSource section in README about the mandatory fields in the event object. You could also refer to the code in demo page.