diff options
author | jwangen <jwangen> | 2002-09-30 03:50:40 +0000 |
---|---|---|
committer | jwangen <jwangen> | 2002-09-30 03:50:40 +0000 |
commit | 4706c676d2c1995efdac08750f66f5ce37529866 (patch) | |
tree | 5bc060e9b38814ebe1c5f09d39a42bde0b6913ea /functions/list_weeks.php | |
parent | 7aeb7747f21d936f33ced01e19073c6f9957f5a3 (diff) | |
download | phpicalendar-4706c676d2c1995efdac08750f66f5ce37529866.tar.gz phpicalendar-4706c676d2c1995efdac08750f66f5ce37529866.tar.bz2 phpicalendar-4706c676d2c1995efdac08750f66f5ce37529866.zip |
dateOfWeek now expects 3 char day names, instead of Apple's 2 char names
Diffstat (limited to 'functions/list_weeks.php')
-rw-r--r-- | functions/list_weeks.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/functions/list_weeks.php b/functions/list_weeks.php index 578193b..58d1465 100644 --- a/functions/list_weeks.php +++ b/functions/list_weeks.php @@ -5,18 +5,17 @@ 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]; -$i = 0; + $check_week = strtotime($getdate); -$week_time = sundayOfWeek($this_year,"1","1"); -$start_week_time = strtotime(dateOfWeek($week_time, substr($week_start_day, 0, 2))); -$end_week_time2 = $start_week_time + (6 * 25 * 60 * 60); -$week_time = $start_week_time; + +$start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("$this_year-01-01")), $week_start_day)); +$end_week_time = $start_week_time + (6 * 25 * 60 * 60); print "<form>\n<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n"; // build the <option> tags do { - $weekdate = date ("Ymd", $week_time); + $weekdate = date ("Ymd", $start_week_time); $select_week1 = strftime($dateFormat_week_jump, $start_week_time); $select_week2 = strftime($dateFormat_week_jump, $end_week_time); @@ -25,15 +24,9 @@ do { } else { print "<option value=\"week.php?cal=$cal&getdate=$weekdate\">$select_week1 - $select_week2</option>\n"; } - $week_time = strtotime ("+1 week", $week_time); - $week_year = date("Y", $month_time); - $wDay = date ("d", $week_time); - $wMonth = date ("m", $week_time); - $start_week_time = sundayOfWeek($this_year,$wMonth,$wDay); - $start_week_time = strtotime($start_week_time); + $start_week_time = strtotime ("+1 week", $start_week_time); $end_week_time = $start_week_time + (6 * 25 * 60 * 60); - $i++; -} while (((date("Y", $start_week_time)) == $this_year) && ($i > 0)); +} while (date("Y", $start_week_time) <= $this_year); // finish <select> print "</select>\n</form>"; |