From e96724021e22328d14046f26bb57aed12275bb12 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 26 Sep 2002 18:33:52 +0000 Subject: Revised next, prev day nagivation, did in 1/3 the code. --- day.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'day.php') diff --git a/day.php b/day.php index 4ef70d7..014ac75 100644 --- a/day.php +++ b/day.php @@ -14,23 +14,10 @@ $starttime = "0700"; $weekstart = 1; $gridLength = 30; $today_today = date ("Ymd"); - -if ($getdate == (date("Ymd"))) { - $display_date = strftime ($dateFormat_day); - $tomorrows_date = date( "Ymd", (time() + (24 * 3600))); - $yesterdays_date = date( "Ymd", (time() - (24 * 3600))); -} else { - ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); - $this_day = $day_array2[3]; - $this_month = $day_array2[2]; - $this_year = $day_array2[1]; - $unix_time = mktime(0,0,0,"$this_month","$this_day","$this_year"); - $display_date = strftime($dateFormat_day, $unix_time); - $tomorrow = $unix_time + (24 * 3600); - $yesterday = $unix_time - (24 * 3600); - $tomorrows_date = date( "Ymd", ($tomorrow)); - $yesterdays_date = date( "Ymd", ($yesterday)); -} +$unix_time = strtotime($getdate); +$display_date = strftime($dateFormat_day, $unix_time); +$tomorrows_date = date( "Ymd", strtotime("+1 day", $unix_time)); +$yesterdays_date = date( "Ymd", strtotime("-1 day", $unix_time)); ?> -- cgit v1.2.3