aboutsummaryrefslogtreecommitdiffstats
path: root/day.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-09-26 18:33:52 +0000
committerChad Little <clittle@users.sourceforge.net>2002-09-26 18:33:52 +0000
commite96724021e22328d14046f26bb57aed12275bb12 (patch)
treefa0b94e2f9b11a39aa6becd676f4f6aa6bf3cb40 /day.php
parent3efd82ee9a2542ae4a1a88b85c5fdbd2c6d368b8 (diff)
downloadphpicalendar-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.php21
1 files changed, 4 insertions, 17 deletions
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));
?>

© 2014-2024 Faster IT GmbH | imprint | privacy policy