Warum auch immer der Autor das darüber gelöst hat.
Ganz offensichtlich wollte er es möglichst kompliziert machen und hat dann die Lust verloren. 😟
class MonthCalendar
{
public $locale = 'en_US.utf-8';
# show https://msdn.microsoft.com/en-us/library/39cwe7zf(v=vs.90).aspx
# show https://msdn.microsoft.com/en-us/library/cdax410z(v=vs.90).aspx
# show ~> locale -a in a Linux-Shell
public $maxDayNamesLength = 2; # 1 | 2 | 3 | 99
public $daysLinkSprintf = 'calendar.php?y=%04d&m=%02d&d=%02d';
public $daysSprintf = '%02d'; # %d, %02d
public $outsideDaysShow = ' ';
public $htmlCalendarId = 'Calendar';
public $htmlCalendarClass = 'Calendar';
public $htmlThisDayId = 'ThisDay';
public $htmlHolidayClass = 'Holyday';
public $htmlPartialHolidayClass = 'PartialHolyday';
public $htmlSondayClass = 'Son';
public $htmlSaturdayClass = 'Sat';
public $yearNextSymbol = '⇨';
public $yearBeforeSymbol = '⇦';
public $monthNextSymbol = '→';
public $monthBeforeSymbol = '←';
public $arMonthList = false;
public $arWeekdayList = false;
public $showYear = true;
public $showMonth = true;
public $showWeekNr = true;
public $datum = false;
public function __construct() {
$this -> datum = mktime( 0,0,0, date('n'), 1, date('Y') );
if ( $this -> locale ) {
$this -> setLocale ( $this -> locale );
}
}
private function getMonthNames() {
for ( $i = 1; $i < 13; $i++ ) {
$d = mkTime( 0, 0, 0, $i, 1, 1971 );
$names[$i] = strftime( '%B', $d );
}
$names[0] = false;
return $names;
}
private function getWeekDayNames() {
for ( $i = 1; $i < 8; $i++ ) {
$d = mkTime(0, 0, 0, 1, 3+$i, 1971);
$names[$i] = substr( utf8_encode( strftime( '%A', $d ) ), 0, $this -> maxDayNamesLength);
}
$names[0] = false;
return $names;
}
public function setLocale( $locale ) {
if ( false === setlocale( LC_TIME, $locale ) ) {
trigger_error("Ungültige Locale-Einstellung: $locale", E_USER_NOTICE);
}
$this -> arMonthList = $this -> getMonthNames();
$this -> arWeekdayList = $this -> getWeekDayNames();
}
### …
Geht.