Calendar

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 28, 2010   (RSS)

By Toledoh - April 27, 2010

Hi Guys,

I found this today: http://arshaw.com/fullcalendar/ and it looks to me to be a good fit for CMSB.

It can call data from a JSON feed and can also call multiple feeds at once.

It's beyond my abilities at the moment, but I was wondering if you could have a look at it and let me know if you think it's feasible.
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Calendar

By Toledoh - April 28, 2010

Me again :)

I've ben playing around with this today, and it works brilliantly... (although I couldn't get the JSON version to work - I'm sure we will though.)

Hard Coded: http://www.forrest.id.au/nutsnbolts/calendar/examples/test1.php

CMSB Generated: http://www.forrest.id.au/nutsnbolts/calendar/examples/test2.php

The only issue is Internet Explorer (surprise!).

my code is:
<?php foreach ($test_eventsRecords as $record): ?>
{
title: '<?php echo $record['title'] ?>',
start: "<?php echo date("Y-m-d H:i", strtotime($record['start'])) ?>"
},
<?php endforeach ?>


Which places a comma at the end of each loop - however, IE gets upset with the final record having a comma after it.

How do I get rid of that last comma?
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Calendar

By Jason - April 28, 2010

Hi Tim,

You could try this:

<?php $count=0; ?>
<?php foreach ($test_eventsRecords as $record): ?>
<?php ($count)? print(",") : $count++ ?>
{
title: '<?php echo $record['title'] ?>',
start: "<?php echo date("Y-m-d H:i", strtotime($record['start'])) ?>"
},
<?php endforeach ?>


This will put a comma BEFORE each entry, except for the first one.

Give that a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/