add setUntil() method

master
Tanguy Pruvot 2010-10-29 12:58:19 +02:00
rodzic d36357770c
commit bd10ff1266
1 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -80,6 +80,18 @@ class SG_iCal_Recurrence {
}
}
/**
* Set the $until member
* @param mixed timestamp (int) / Valid DateTime format (string)
*/
public function setUntil($ts) {
if ( is_int($ts) )
$dt = new DateTime('@'.$ts);
else
$dt = new DateTime($ts);
$this->until = $dt->format('Ymd\THisO');
}
/**
* Retrieves the desired member variable and returns it (if it's set)
* @param string $member name of the member variable
@ -106,7 +118,6 @@ class SG_iCal_Recurrence {
* @return mixed string if the member has been set, false otherwise
*/
public function getUntil() {
return $this->getMember('until');
}