0

I'm working on a site in which I have incorporated a calendar of events, which also serves as navigation in the events page. That is to say that when I click on a calendar date associated events occur. To do this I integrate the plugin jQuery.Simple-Event-Calendar, this plugin uses a jquery json file to load events. My problem is that I can not retrieve my calendar events with good dates. Would anyone have any idea how I could do to recover my posts good dates via json or via the query wordpress?

Thank you in advance !!

1
  • What do you mean by good dates?
    – jgraup
    Commented Nov 3, 2016 at 3:43

1 Answer 1

0

I think the missing piece to this is; where does your data currently live? If you have an endpoint for the JSON then parsing via jQuery is pretty straightforward.

<script>
    jQuery.getJSON ({
        url: 'https://raw.githubusercontent.com/philipehsing/jQuery.Simple-Event-Calendar/master/demo/data/events.json',
    })
    .done (function(data) {
        for (var i in data.events) {
            var event = data.events[i];
            var date = event.month + "/" + event.day + "/" + event.year;
            console.log (event.title + " is on " + date);
        }
    })
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.