הגדרות Language:

שיטה:

ספירת העומר:

ערבי חגים:

אסרו חג:

תזכורת: מכיוון שאתה צופה בגרסה העברית של לוח השנה, יתכן שאתה מצפה לראות את מועדי החגים כפי שהם נהוגים בארץ ישראל. שנה ל"ארץ ישראל" את הבחירה בתפריט "שיטה" כדי שכך יהיה.
ראשוןשנישלישירביעיחמישישישישבת
1 כז
2 כח 3 כט
ערב ראש השנה
4 א (תשרי)
א' ראש השנה
5 ב
ב' ראש השנה
6 ג
צום גדליה
7 ד 8 ה
9 ו 10 ז 11 ח 12 ט
ערב יום הכיפורים
13 י
יום הכיפורים
14 יא 15 יב
16 יג 17 יד
ערב סוכות
18 טו
סוכות
19 טז
סוכות ב' (גולה)
20 יז
חול המועד סוכות
21 יח
חול המועד סוכות
22 יט
חול המועד סוכות
23 כ
חול המועד סוכות
24 כא
הושענא רבה
25 כב
שמיני עצרת
26 כג
שמחת תורה
27 כד 28 כה 29 כו
30 כז 31 כח

פיד iCal

The Source Code

You may download the source code and use it on your website. It's GPLed.

The API

The most important part of the code is the JewishCalendar PHP class. It contains the 'brain' that calculates the holidays. It is derived from the base class NativeCalendar, so you should add also this to the bundle. The rest of the code, including the GUI you see here, is considered a demonstration of how to use this class and is appropriately contained in files having 'demo' in their names (e.g. 'demo.php').

Here's a taste of the API:

require_once 'NativeCalendar.php';

$jcal = NativeCalendar::factory('Jewish'); // In the future there may be Drivers
                                           // for other calendars.

$jcal->settings(array(
  'language' => CAL_LANG_NATIVE, // Speak in Hebrew, not English.
  'diaspora' => FALSE,           // We don't live abroad.
  'eves'     => TRUE,            // Give us 'Erev Rosh HaShana' too.
));

// Let's print the holidays for the next 20 days.

$timestamp = time();

for ($n = 20; $n--; ) {
  print 'Holidays for '. date('Y-m-d', $timestamp) .":\n";
  foreach ($jcal->getHolidays($timestamp) as $holiday) {
    print "   $holiday[name]\n";
  } 
  $timestamp += 60*60*24; // Advance to the next day
}

The output of this snippet is:

Holidays for 2007-09-20:
Holidays for 2007-09-21:
   ערב יום הכיפורים
Holidays for 2007-09-22:
   יום הכיפורים
Holidays for 2007-09-23:
Holidays for 2007-09-24:
Holidays for 2007-09-25:
Holidays for 2007-09-26:
   ערב סוכות
Holidays for 2007-09-27:
   סוכות
Holidays for 2007-09-28:
   חול המועד סוכות
Holidays for 2007-09-29:
   חול המועד סוכות
Holidays for 2007-09-30:
   חול המועד סוכות
Holidays for 2007-10-01:
   חול המועד סוכות
Holidays for 2007-10-02:
   חול המועד סוכות
Holidays for 2007-10-03:
   הושענא רבה
Holidays for 2007-10-04:
   שמיני עצרת
‎   שמחת תורה
Holidays for 2007-10-05:
Holidays for 2007-10-06:
Holidays for 2007-10-07:
Holidays for 2007-10-08:
Holidays for 2007-10-09:

Let's have another script...

// Print today's date:
print $jcal->getLongDate(time()) ."\n";

// Now in English:
$jcal->settings(array('language' => CAL_LANG_FOREIGN));
print $jcal->getLongDate(time()) ."\n";

// When did the first man land on the moon?
print $jcal->getLongDate('1969-07-20') ."\n";

...which outputs:

ח' תשרי ה'תשס"ח
8 Tishrei, 5768
5 Av, 5729

Localization

The calendar comes speaking in two languages: Hebrew and English. But you can make it speak any other language. This is due to the fact that all English strings --month names and holiday names-- are enveloped in a special function. Mavens will recognize this as "the Gettext method of localizing strings." I chose the name 't' for this function.

In large projects you'd use various gettext tools to extract (see JewishCalendar.pot) and translate the strings, but it's actually enough to implement a simple-minded t() function in your script. Here's an example:

require 'NativeCalendar.php';

$jcal = NativeCalendar::factory('Jewish'); // In da future they may be drivers
                                           // fo otha calendars.
$jcal->settings(array(
  'language' => CAL_LANG_FOREIGN,
  'diaspora' => TRUE,
));

function t($s) {
  static $table = array(
    'Tishrei' => 'Teeshre',
    'Erev Rosh HaShana' => 'Justa little bit before da start of da year.',
    'Rosh HaShana I' => 'Da start of da year.',
    'Rosh HaShana II' => 'Anotha start of da year, man. See? There be two.',
    'Yom Kippur' => "Da 'No TV' day.",
    'Tsom Gedalya' => 'Rememba poor Gedalya, OK?',
    'Sukkot' => "You's squizin' yo' TV inside this thingy a here.",
  );
  if (isset($table[$s])) {
    return $table[$s];
  } else {
    return $s;
  }
}

// Dig dis:
print $jcal->printCal(2007, 9);