This commit is contained in:
Andreas Österreicher
2010-01-22 12:50:59 +00:00
parent 9d6ae6a593
commit 39cb8720b0
2 changed files with 23 additions and 3 deletions
+16
View File
@@ -185,6 +185,22 @@ function montag($datum)
return $datum;
}
/**
* Springt zum naechsten Wochentag
*
* @param $timestamp
* @param $weekday Wochentag zu dem gesprungen werden soll (0-6, 0=Sonntag)
* @return timestamp
*/
function jump_weekday($timestamp, $weekday)
{
$wt = date("w",$timestamp);
$jump = 7-$wt+$weekday;
if($jump>7)
$jump = $jump-7;
return jump_day($timestamp, $jump);
}
function jump_day($datum, $tage)
{
// Ein Tag sind 86400 Sekunden