FeralSimpleCalendar

Summary: A small simple calendar suitable for a rightbar, or header/footer or anywhere you wish.
Version: 2007-03-15
Prerequisites: None.
Status: New derivative code base but solid;
Maintainer: Feral
Categories: blog,pim,calendar

Questions answered by this recipe

How do I place a small calendar displaying the current date on a wiki page?

This recipe will do just that, and only that.

Description

A small simple calendar, ONLY.

Appearance by default is such:

Image displays both day start styles, and bottom date separators, examples

  • Left -- (default)
    • $feralsimplecalendar_weekstart= 0; // Start on Sunday;
    • $feralsimplecalendar_bottomsmalldatesep = '-'; // 2007-03-15
  • Right:
    • $feralsimplecalendar_weekstart= 1; // Start on Monday;
    • $feralsimplecalendar_bottomsmalldatesep = '/'; // 2007/03/15

Installation

Download feralsimplecalendar.phpΔ and copy to cookbook folder. Add to config.php:

include_once("$FarmD/cookbook/feralsimplecalendar.php");

feralsimplecalendar-20181207.phpΔ is an update to the 2007/03/15 version that addresses “Warning: preg_replace(): The /e modifier is no longer supported” issues (tested on pmwiki-2.2.110).

Customization:

Start on which day:

  • Start on Sunday
    • $feralsimplecalendar_weekstart= 0; // Start on Sunday;
  • Start on Monday
    • $feralsimplecalendar_weekstart= 1; // Start on Monday;

Starting on Sunday is default.

Bottom Small date separator:

This is the date separator for the small date at the bottom left of the calendar;

  • 2007-03-15
    • $feralsimplecalendar_bottomsmalldatesep = '-'; // 2007-03-15
  • 2007/03/15
    • $feralsimplecalendar_bottomsmalldatesep = '/'; // 2007/03/15

I believe any char can be used but I have only tested with the above.

The 2007-03-15 separator format is default.

Day names:

  • By default we use standard USA abbreviations:
    • $feralsimplecalendar_dayname = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
  • The long version would be:
    • $feralsimplecalendar_dayname = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

Change as you desire...

Colors:

Simply define $HTMLStylesFmt['feralsimplecalendar'] before you include feralsimplecalendar.php;

This should contain:

  • div#feralsimplecalendar
  • table.feralsimplecalendar
  • table.feralsimplecalendar caption
  • table.feralsimplecalendar th
  • table.feralsimplecalendar td
  • th.feralsimplecalendar-daynames
  • td.feralsimplecalendar-blank
  • td.feralsimplecalendar-today
  • td.feralsimplecalendar-day

See feralsimplecalendar.php for the default values.

Notes

The calendar code is pretty much blank slate; All my tests show it working/perfect but don't bet your life on it. ;)

Release Notes

  • 2007-03-15: Initial

See Also

Contributors

Comments

See discussion at FeralSimpleCalendar-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.