diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-09-29 23:54:48 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-09-29 23:54:48 +0000 |
commit | c67837c0c7726590613589397c5b4d5e9ce8764a (patch) | |
tree | 9c06ed7fc6ef3d628f264b5b81eb76de8b7634f2 /functions | |
parent | fa2b4fc5737686eacdf09803cd1511bb8a288d1d (diff) | |
download | phpicalendar-c67837c0c7726590613589397c5b4d5e9ce8764a.tar.gz phpicalendar-c67837c0c7726590613589397c5b4d5e9ce8764a.tar.bz2 phpicalendar-c67837c0c7726590613589397c5b4d5e9ce8764a.zip |
settles on current week for popup selection.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/list_weeks.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/functions/list_weeks.php b/functions/list_weeks.php index 407afa5..578193b 100644 --- a/functions/list_weeks.php +++ b/functions/list_weeks.php @@ -6,9 +6,10 @@ $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_time = $start_week_time + (6 * 25 * 60 * 60); +$end_week_time2 = $start_week_time + (6 * 25 * 60 * 60); $week_time = $start_week_time; print "<form>\n<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value);\">\n"; @@ -19,7 +20,7 @@ do { $select_week1 = strftime($dateFormat_week_jump, $start_week_time); $select_week2 = strftime($dateFormat_week_jump, $end_week_time); - if ($monthdate == $getdate) { + if (($check_week >= $start_week_time) && ($check_week <= $end_week_time)) { print "<option value=\"week.php?cal=$cal&getdate=$weekdate\" selected>$select_week1 - $select_week2</option>\n"; } else { print "<option value=\"week.php?cal=$cal&getdate=$weekdate\">$select_week1 - $select_week2</option>\n"; |