---
title: "advanced calendar"
url: "https://www.typo3.net/d/3008-advanced-calendar"
source: "typo3.net"
tags: ["Extensions","Frage"]
created: "2003-05-21"
last_reply: "2004-01-20"
replies: 6
solved: false
page: 1
pages: 1
lang: "de"
---

# advanced calendar

Extensions · 6 Antworten · gestartet 2003-05-21

## Eröffnungsbeitrag

**biz1968** · 2003-05-21 · [Beitrag #1](https://www.typo3.net/d/3008-advanced-calendar/1)

Änderungen die zu machen sind um das Teil auf Deutsch zum laufen zu bekomen:

**class.tx_advCalendar_pi1.php**
(ganz oben)
**Datum + Zeitformatierung auf deutsch umstellen**

function translate($what) {
	return $what;
}
setlocale(LC_TIME,"de_DE");
$calendar_script = "index.php";

(error meldungen)
**mittels ereg datum umformatieren damit strtotime funktioniert**

if(strlen($this->dataArr["title"])<1){
				$errors[count($errors)]=$lConf["errMsgNoTitle"];
			}

			$markerArray["###CREATEUID###"]=$this->dataArr['tx_advCalendar_fe_cruser_id'];
			$markerArray["###NOTE###"]=$this->dataArr["note"];
			$markerArray["###PLACE###"]=$this->dataArr["place"];

$markerArray["###CATEGORY###"]=$this->makeCategorySelect(1, $this->dataArr["category"]);
// formatiert dd.mm.yyyy nach mm/dd/yyyy
ereg ("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $this->dataArr["date"], $regs);
$startdate1 = ("$regs[2]/$regs[1]/$regs[3]");

$startdate = strtotime($startdate1);

			$this->dataArr["date"] = $startdate;
			if ($startdate == -1){$errors[count($errors)]=$lConf["errMsgStartDateNotValid"];}
			$markerArray["###SDATE###"]=strftime($this->conf['generalDateFormat'], $startdate);

			$starttime=strtotime($this->dataArr["time"]);
			$this->dataArr["time"] = $this->timestamp($starttime);
			if($starttime == -1){$errors[count($errors)]=$lConf["errMsgStartTimeNotValid"];}

$starttime = strftime($this->conf["generalTimeFormat"], $starttime);
			$markerArray["###STIME###"]= $starttime;
// formatiert dd.mm.yyyy nach mm/dd/yyyy
ereg ("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $this->dataArr["tx_advCalendar_enddate"], $regs);
$enddate1 = ("$regs[2]/$regs[1]/$regs[3]");

			$startdate = strtotime($enddate1);
			$markerArray["###EDATE###"]=$this->dataArr["tx_advCalendar_enddate"]?strftime($this->conf['generalDateFormat'], $startdate):"";
			if ($startdate == -1){$errors[count($errors)]=$lConf["errMsgEndDateNotValid"];}
			else $this->dataArr["tx_advCalendar_enddate"] = $this->dataArr["tx_advCalendar_enddate"]?$startdate:0;

			$endtime=strtotime($this->dataArr["tx_advCalendar_totime"]);
			if($endtime == -1){$errors[count($errors)]=$lConf["errMsgEndTimeNotValid"];}
			else $this->dataArr["tx_advCalendar_totime"] = $this->timestamp($endtime);
			$endtime = $this->dataArr["tx_advCalendar_totime"]?strftime($this->conf["generalTimeFormat"], $endtime):"";
			$markerArray["###ETIME###"]=$endtime;

//this is if u want to use time combos
			$markerArray["###TIME_SELECT1###"] = $this->makeTimeSelect(2,$starttime);
			$markerArray["###TIME_SELECT2###"] = $this->makeTimeSelect(2,$endtime);

$markerArray["###ACTION###"]=$this->pi_getPageLink($GLOBALS["TSFE"]->id,"");
			$markerArray["###EDITFLAG###"]=$editflag;

list($markerArray["###ERRORMSG###"])=$errors;

**popup/calendar.html
ändern**
var ARR_MONTHS = ["Januar", "Februar", "März", "April", "Mai", "Juni",
		"Juli", "August", "September", "Oktober", "November", "Dezember"];
// week day titles as they appear on the calendar
var ARR_WEEKDAYS = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
// day week starts from (normally 0-Mo or 1-Su)
var NUM_WEEKSTART = 0;
// path to the directory where calendar images are stored. trailing slash req.

**pi1/advcalendar.html
ändern**

<script language="JavaScript" type="text/javascript">
<!--
function submitForm(theForm) {
	var delete_event = theForm.delete_event.value;
	if (delete_event == '1') {
		if (confirm("Are you sure, do you want to delete event???")) return true
			else return false;
	} else return true;
}
//-->
</script>
<script language="JavaScript" src="###PLUGIN_PATH###/popup/calendar1.js"></script>

**ext_typoscript_setup.txt
ändern**

mit einbauen wie bei <http://typo3.org/doc.0.html?&tx_extrepmgm_pi1%5BextUid%5D=373&tx_extrepmgm_pi1%5BtocEl%5D=1318&cHash=e2fcf2dd12> auch aufgeführt

timeSelect.Start = 8
timeSelect.End = 23
timeSelect.Interval = 30
fillEndDate = 1

**popup/calendar1.js**
// Title: Tigra Calendar
// URL: <http://www.softcomplex.com/products/tigra_calendar/>
// Version: 3.2 (European date format)
// Date: 10/14/2002 (mm/dd/yyyy)
// Feedback: feedback@softcomplex.com (specify product title in the subject)
// Note: Permission given to use this script in ANY kind of applications if
//    header lines are left unchanged.
// Note: Script consists of two files: calendar?.js and calendar.html
// About us: Our company provides offshore IT consulting services.
//    Contact us at sales@softcomplex.com if you have any programming task you
//    want to be handled by professionals. Our typical hourly rate is $20.

// if two digit year input dates after this year considered 20 century.
var NUM_CENTYEAR = 30;
// is time input control required by default
var BUL_TIMECOMPONENT = false;
// are year scrolling buttons required by default
var BUL_YEARSCROLL = true;
//GASTAN
// path to html
var STR_PATH = "";

var calendars = [];
var RE_NUM = /^-?d+$/;

function calendar1(obj_target) {

// assing methods
	this.gen_date = cal_gen_date1;
	this.gen_time = cal_gen_time1;
	this.gen_tsmp = cal_gen_tsmp1;
	this.prs_date = cal_prs_date1;
	this.prs_time = cal_prs_time1;
	this.prs_tsmp = cal_prs_tsmp1;
	this.popup    = cal_popup1;

// validate input parameters
	if (!obj_target)
		return cal_error("Error calling the calendar: no target control specified");
	if (obj_target.value == null)
		return cal_error("Error calling the calendar: parameter specified is not valid tardet control");
	this.target = obj_target;
	this.time_comp = BUL_TIMECOMPONENT;
	this.year_scroll = BUL_YEARSCROLL;
	this.path = STR_PATH;

	// register in global collections
	this.id = calendars.length;
	calendars[this.id] = this;
}

function cal_popup1 (str_datetime) {
	this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
	if (!this.dt_current) return;

var obj_calwindow = window.open(
		this.path + 'calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
		'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
		',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
	);
	obj_calwindow.opener = window;
	obj_calwindow.focus();
}

// timestamp generating function
function cal_gen_tsmp1 (dt_datetime) {
	return(this.gen_date(dt_datetime) + ' ' + this.gen_time(dt_datetime));
}

// date generating function
function cal_gen_date1 (dt_datetime) {
	return (
		(dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "."
		+ (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "."
		+ dt_datetime.getFullYear()
	);
}
// time generating function
function cal_gen_time1 (dt_datetime) {
	return (
		(dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":"
		+ (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":"
		+ (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds())
	);
}

// timestamp parsing function
function cal_prs_tsmp1 (str_datetime) {
	// if no parameter specified return current timestamp
	if (!str_datetime)
			return (new Date());

// if positive integer treat as milliseconds from epoch
	if (RE_NUM.exec(str_datetime))
		return new Date(str_datetime);

	// else treat as date in string format
	var arr_datetime = str_datetime.split(' ');
	return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0]));
}

// date parsing function
function cal_prs_date1 (str_date) {

var arr_date = str_date.split('.');

if (arr_date.length != 3) return cal_error ("falsches Datumsformat: '" + str_date + "'.
Format tt.mm.jjjj.");
	if (!arr_date[0]) return cal_error ("falsches Datumsformat: '" + str_date + "'.
Monat fehlt.");
	if (!RE_NUM.exec(arr_date[0])) return cal_error ("falsches Tagesformat: '" + arr_date[0] + "'.
");
	if (!arr_date[1]) return cal_error ("falsches Datumsformat: '" + str_date + "'.
Monat fehlt.");
	if (!RE_NUM.exec(arr_date[1])) return cal_error ("falsches Monatsformat: '" + arr_date[1] + "'.
");
	if (!arr_date[2]) return cal_error ("falsches Datumsformat: '" + str_date + "'.
Jahr fehlt.");
	if (!RE_NUM.exec(arr_date[2])) return cal_error ("falsches Jahresformat: '" + arr_date[2] + "'.
");

var dt_date = new Date();
	dt_date.setDate(1);

if (arr_date[1] < 1 || arr_date[1] > 12) return cal_error ("Monat: '" + arr_date[1] + "'.
A 01-12.");
	dt_date.setMonth(arr_date[1]-1);

	if (arr_date[2] < 100) arr_date[2] = Number(arr_date[2]) + (arr_date[2] < NUM_CENTYEAR ? 2000 : 1900);
	dt_date.setFullYear(arr_date[2]);

var dt_numdays = new Date(arr_date[2], arr_date[1], 0);
	dt_date.setDate(arr_date[0]);
	if (dt_date.getMonth() != (arr_date[1]-1)) return cal_error ("Tag: '" + arr_date[0] + "'.
Allowed range is 01-"+dt_numdays.getDate()+".");

return (dt_date)
}

// time parsing function
function cal_prs_time1 (str_time, dt_date) {

if (!dt_date) return null;
	var arr_time = String(str_time ? str_time : '').split(':');

if (!arr_time[0]) dt_date.setHours(0);
	else if (RE_NUM.exec(arr_time[0]))
		if (arr_time[0] < 24) dt_date.setHours(arr_time[0]);
		else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.
Allowed range is 00-23.");
	else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.
Allowed values are unsigned integers.");

	if (!arr_time[1]) dt_date.setMinutes(0);
	else if (RE_NUM.exec(arr_time[1]))
		if (arr_time[1] < 60) dt_date.setMinutes(arr_time[1]);
		else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.
Allowed range is 00-59.");
	else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.
Allowed values are unsigned integers.");

if (!arr_time[2]) dt_date.setSeconds(0);
	else if (RE_NUM.exec(arr_time[2]))
		if (arr_time[2] < 60) dt_date.setSeconds(arr_time[2]);
		else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.
Allowed range is 00-59.");
	else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.
Allowed values are unsigned integers.");

dt_date.setMilliseconds(0);
	return dt_date;
}

function cal_error (str_message) {
	alert (str_message);
	return null;
}

**diese Änderungen betreffen im Moment nur die Datumsfunktionen
wenn das Teil läuft, läuft es gut,
aber ziemlich schlampig programmiert**

ansonsten erst mal alle Einstellungen wie in der Referenz angegeben vornehmen

## Antworten

### [#2](https://www.typo3.net/d/3008-advanced-calendar/2) · timic · 2004-01-06

Endlich! Vielen Dank für deine Mühe, du hast einen Orden verdient!

Gruß
Christine

### [#3](https://www.typo3.net/d/3008-advanced-calendar/3) · biz1968 · 2004-01-12

auch Grüsse an Herrn Hueber

hoffe er schickt mir keine Aufforderungen zur Unterlassung mehr

### [#4](https://www.typo3.net/d/3008-advanced-calendar/4) · timic · 2004-01-12

Ich richte es ihm aus.    ;)

Gruß,
Christine

(+ Michael Hueber)

### [#5](https://www.typo3.net/d/3008-advanced-calendar/5) · Torsten · 2004-01-19

Schade
folgender Fehler auf der Seite:

( ), 'is' => Array ( ), 'hr' => Array ( ), 'hu' => Array ( ), 'gl' => Array ( ), ); ?>

Kann mir jemand seine geänderten Dateien zumailen
oder zum download anbieten?

Gruß
Torsten

### [#6](https://www.typo3.net/d/3008-advanced-calendar/6) · biz1968 · 2004-01-20

Hallo Thorsten...

ich habe das Ding mittlerweile rausgeworfen

und leider noch keinen Ersatz gefunden

suche mal auf typo3.org nach adv calendar

"Millionen" von Einträgen

das Ding ist einfach schrottig programmiert.....
ist fast jeder Funktion ist eine Fehler drin

den Javascript Kalender müsste mal eigentlich komplett umprogrammieren

Grüsse Ralf
(auch wenn das wahrscheinlich nicht die Antwort war, die Du haben wolltest)

### [#7](https://www.typo3.net/d/3008-advanced-calendar/7) · Torsten · 2004-01-20

> **biz1968 schrieb:**
>
> auch wenn das wahrscheinlich nicht die Antwort war, die Du haben wolltest

Damit hast Du recht, schade eigentliche finde ich den
"Calendar" ganz schön, ich werde es weiterversuchen, DANKE!

Gruß
Torsten

---

Quelle: „advanced calendar“, typo3.net, https://www.typo3.net/d/3008-advanced-calendar
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
