diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-09-26 18:33:52 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-09-26 18:33:52 +0000 |
commit | e96724021e22328d14046f26bb57aed12275bb12 (patch) | |
tree | fa0b94e2f9b11a39aa6becd676f4f6aa6bf3cb40 /day.php | |
parent | 3efd82ee9a2542ae4a1a88b85c5fdbd2c6d368b8 (diff) | |
download | phpicalendar-e96724021e22328d14046f26bb57aed12275bb12.tar.gz phpicalendar-e96724021e22328d14046f26bb57aed12275bb12.tar.bz2 phpicalendar-e96724021e22328d14046f26bb57aed12275bb12.zip |
Revised next, prev day nagivation, did in 1/3 the code.
Diffstat (limited to 'day.php')
-rw-r--r-- | day.php | 21 |
1 files changed, 4 insertions, 17 deletions
@@ -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)); ?> |