Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A miniature calendar widget using PHP and Prototype.js. Edit a simple text file to update the events shown in the calendar.
PHP JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
css
data
images
javascripts
lib
README.markdown
index.html

README.markdown

This is a rock-simple PHP calendar

It uses the venerable Unix utility cal to generate a text calendar, a simple text document containing the calendar events, and a mixture of CSS and JavaScript to create links to those events.

Naturally, it only works on a Unix or Linux server, and since I'm a total Prototype-head, it uses the Prototype JavaScript library, (so no jQuery if you know what's good for you!).

Instructions

Upload the entire project to your server, and edit the data/data.txt files to reflect your own calendar.

The format is simple -- Date in ISO, a space, a URL that the date should link to, another space, and a title for the link. If you create more than one link for any given day, the JavaScript will create a multi-select widget to expose them for the user.

2011-03-11 http://apple.com Apple, Inc.
2011-03-05 http://walterdavisstudio.com Walter Davis Studio
2010-12-31 http://timessquare.com Times Square
2011-03-11 http://store.apple.com Apple Store

Edit the lib/minical.php line 2 to reflect the time zone you want to use, unless you are in the US East Coast time zone.

Add script tags for prototype.js and cal.js to the head of your HTML page, and link to the stylesheet css/minical.css. Create a DIV on your page with the classname minical. Preview in a browser, and you should see a tiny calendar in the page replacing any contents of that DIV. If you want to add a "sorry, you don't have JavaScript enabled" message, just put that inside the DIV.minical element.

Something went wrong with that request. Please try again.