Jump to content

Tutorial: HowTo create a simple Eventcalendar


Luis

Recommended Posts

This is a great tutorial! I've got the events calendar up and running and now I'm working on customization.

Has anyone used this calendar with multi-day events? We have a lot of events that run on Saturday and Sunday. I could duplicate the event (ie "Day Two") as a separate entry if I needed to, but I wondered if anyone had tried multi-day events before a different way. I'm using the code snippet for allowing multiple events on one day, too, btw.

Thanks!

Link to comment
Share on other sites

I think that supporting multi-day events would just be a matter of adding an end_date field, and consider the existing date field a start_date field. Either that, or you could use a "number of days" field instead of an end_date, but I think having distinct start_date and end_date fields is better because they can support a time component, and they can be queried more easily. 

Link to comment
Share on other sites

  • 9 months later...
  • 4 months later...
  • 1 year later...
  • 1 year later...
  • 1 year later...
  • 10 months later...

hey there,

i'm pretty sure it's a dumb question, but im getting console errors for unexpected tokens: <

 

var cal = $( '#calendar' ).calendario({
        displayWeekAbbr : true,
        caldata : {
            <?= getEvents(); ?> // this is our function to grab our events
         }
    });

 

Link to comment
Share on other sites

Looks like you've placed the inline script into a JS file, right? In that case you'll need a different approach to get the event data into the JS world, the PHP injection from

<?= getEvents(); ?>

does only work when you embed the whole <script>...</script> block into your markup.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...