title: Load JSON Data Items into React Native Calendar Agenda
body: <p>I'm trying to load JSON Data into my Calendar Agenda but I'm not able to. There is not much documentation on how to load JSON into Agenda items by comparing them to dates either. Can someone please help me. This is my JSON Data.
  I'm trying to Load Items for a particular date using the Agenda_TimeStamp field. I have another page where I'm post the data into my sql database from where I'm pulling the data here from. I want to show the contents of the JSON data on specific dates with respect to Agenda_Timestamp</p>
  <pre><code> {
          &quot;AgendaName&quot;: null,
          &quot;User_ID&quot;: 100,
          &quot;Agenda_DESC&quot;: &quot;TEST&quot;,
          &quot;Agenda_TIMESTAMP&quot;: &quot;2020-08-04 02:44:14&quot;,
          &quot;Agenda_TYPE&quot;: &quot;CO&quot;,
          &quot;Agenda_ID&quot;: 100
      }
  </code></pre>
  <p>I'm trying to load this data in the agenda using this react native code</p>
  <pre><code>import axios from 'axios';
  import { Calendar, CalendarList, Agenda } from 'react-native-calendars';
  
  const HomeScreen = () =&gt; {
  useEffect(() =&gt; {
          const fetchData = async () =&gt; {
              const result = await axios(
                  'http://localhost/restservice/Agenda/',
              );
  
              setData(result.data);
          };
  
          fetchData();
      }, []);
      const timeToString = (time) =&gt; {
          const date = new Date(time);
          return date.toISOString().split('T')[0];
      };
  
      const [data, setData] = useState([]);
     /*  const [date, setDate] = useState(new Date()); */
      const [items, setItems] = useState([]);
     /*  const onChange = date =&gt; {
          setDate(date);
      }; */
  
      const loadItems =(day) =&gt; {
          setTimeout(() =&gt; {
              for (let i = -15; i &lt; 85; i++) {
                  const time = day.timestamp + i * 24 * 60 * 60 * 1000;
                  const strTime = timeToString(time);
                  if (!items[strTime]) {
                      items[strTime] = [];
                      const numItems = Math.floor(Math.random() * 3 + 1);
                      for (let j = 0; j &lt; data.count(); j++) {
                          items[strTime].push({
                              name: 'Item for ' + strTime + ' #' + j,
                              height: Math.max(50, Math.floor(Math.random() * 150))
                          });
                      }
                  }
      }
  
              const newItems = {};
              Object.keys(data).forEach(key =&gt; { newItems[data.Agenda_id] = data[Agenda_TYPE]; });
              setItems(newItems);
          }, 1000);
      }
  
  
  
      const renderItem = (item) =&gt; {
          return (
             
                  &lt;TouchableOpacity style={[styles.item, { height: item.height }]}
                      onPress={() =&gt; alert(item.name)}&gt;
  
                      &lt;Text&gt;
                          {item.name}
                      &lt;/Text&gt;
  
                  &lt;/TouchableOpacity&gt;
     
             
  
          );
      };
  
  
      return (
          &lt;View style={styles.container}&gt;
              &lt;StatusBar barStyle={theme.dark ? &quot;light-content&quot; : &quot;dark-content&quot;} /&gt;
           
              &lt;Agenda theme={{
                  
              }}
                      items={items}
                      loadItemsForMonth={loadItems}
                      renderItem={renderItem}
                    
                  /&gt;
             
              
          &lt;/View&gt;
      );
  };
  export default HomeScreen;
  </code></pre>