Archive for the ‘Zend Calendar’ Category

Zend Calendar supports events

Monday, September 14th, 2009

I finally ran into a situation where my calendar needed events so I added the functionality tonight. You can currently create events using a Zend_DbTable or a regular array but extending Spiffy_Calendar_Event_Abstract allows you to create events from any source (JSON/Google Calendar come to mind).

$calendar = new Spiffy_Calendar();

// Array using object
$test = new Spiffy_Calendar_Event_Array($calendar);
$test->setData(array(array('title' => 'Array with event')));
$test->setDay(1);
$calendar->createEvent($test);

// Array using type
$calendar->createEvent('array', array(array('title' => 'Array with type')), array('day' => '25'));

// Table using type with date set using date_field and date_format
$calendar->createEvent('table', new Default_Model_DbTable_Event(), 
        array('date_field' => 'date', 'date_format' => 'YYYY-MM-DD'));

// Table using object with select using current date
$test2 = new Spiffy_Calendar_Event_Table($calendar);
$test2->setData(new Default_Model_DbTable_Event());
$test2->getSelect()->where('id = ?', 2);

$calendar->createEvent($test2);

$this->view->calendar = $calendar;

The above code generates a table that looks like:

SpiffyCalendar with events demonstration

SpiffyCalendar with events demonstration

I think SpiffyCalendar is finally starting to come together. More to come!

Zend Calendar for the Zend Framework

Sunday, September 13th, 2009

Finding a Calendar

I ran into a situation this weekend where I needed a calendar for Zend_Framework. I spent an hour or so searching but couldn’t find anything that fit my tastes so I made my own. My calendar uses Zend_Date and Zend_Locale and is truly Zendy (new word?). It uses a view script to generate the calendar so it’s completely customizable and cssable (another new word?). I call it SpiffyCalendar and it will be available shortly once I wrap up licensing and a few finishing touches.

Features

  • Completely integrated as a library package for Zend Framework.
  • Utilizes Zend_Date and Zend_Locale provided by the Zend Framework.
  • Rendered using different adapters (ships with Zend_View and a view script).
  • Released under the GNU GPL license
  • Support for adding events/appointments.
  • Easily AJAXified

Example

Simple Calendar

SpiffyCalendar - Simple Example

SpiffyCalendar - Simple Example