Space Cat, Prince Among Thieves

SimpleCalendar

Recent Activity

Jesse Donat (donatj)

Added the much requested ability to offset by days!
Example HTML cleanup
Slight HTML cleanup
Removed
Time event added, CSS nicer
Path in example fixed

Updated README to reflect namespaces and Composer changes
Class not nested correctly for composer
Requires at least 5.3 due to the namespaces
Added a composer.json file
PSR-0-ified

Prefix and Suffix Added
Update README.md
Slight docs improvment
Executed code formatter on the library
Compass code fixes for tbody
Calendar changed to use localized day names by default.
Lots of slight cleanup
Basic repo restructuring

Updated README to have better code sample display.

Merge branch 'master' of github.com:donatj/SimpleCalendar
Leftover Debugging Echo Removed

Added doc blocks to addDailyHtml and clearDailyHtml

- Fix for months that start on sunday
- Fix for months that end on saturday
Formatting changes to the calendars surrounding table.
Removed an accidental print_r

Event Modification Started

Initial version of SimpleCalendar

SimpleCalendar is a very simple PHP calendar class written to be easy to use and flexible.

It includes basic event logic and is made to be modified to your particular needs.

More Details Soon

Sample Usage

<?php
require_once('SimpleCalendar.php');
$calendar = new donatj\SimpleCalendar();

$calendar->setStartOfWeek('Sunday');

$calendar->addDailyHtml( 'Sample Event', 'today', 'tomorrow' );
$calendar->show(true);
?>

Example Calendar

SunMonTueWedThuFriSat
   
Sample Event
Sample Event
 

Click here for the Github repository.

BuildDateMessage
v0.4.0
Download
 Added the much requested ability to offset by days!
v0.3.2
Download
Fixed a nesting issue
v0.3.1
Download
Fixed a problem with the composer JSON
v0.3.0
Download
PSR-0, Composer
v0.2.0
Download
First tag in a long time, maintence build
v0.1.0
Download
Initial Release

Comment by: Joko Wandiro on

Joko Wandiro Gravatargood PHP Class, very help me.
thanks a ton.

Comment by: joagido on

joagido Gravatarwhat to do to start weeks on monday?

Comment by: Greg Duckworth on

Greg Duckworth GravatarThis is a fantastic little script, although I don't suppose you could add the ability to move forward and back in months ?

Comment by: Jesse G. Donat on

Jesse G. Donat Gravatar

The constructor on Simple Calendar takes a date string (see strtotime()) so an easy way is simply

$cal = new SimpleCalendar('+1 Month');

or

$cal = new SimpleCalendar('June 2012');

There is also a setDate method which allows you to change the date of the calendar after initial construction.


Comment by: Greg Duckworth on

Greg Duckworth GravatarThanks, have it all working now.

Kudos again on the script!

Comment by: HvToor on

HvToor GravatarIt looks great but when I download v0.3.2 and upload it to my website it won't work. I already changed the paths of the files to the right folder.

Hope you can help with it,

Comment by: Jesse G. Donat on

Jesse G. Donat GravatarStarting with .3.0 it is namespaced and requires PHP 5.3+, I'm sorry I did not update the documentation until just now. The example in the source code better illustrates this.

Comment by: Dirk on

Dirk GravatarAs somebody already asked: Is there a simple way to make weeks start on mondays?

Thx in advance

Comment by: Vincent on

Vincent GravatarHow to change the first day of the week is detailed in the 'sample usage'...

Email address will never be publicly visible.