Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 11 Apr 2002 20:12:51 -0000 1.14 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-2-procs.tcl 26 Apr 2002 19:50:41 -0000 1.15 @@ -12,8 +12,8 @@ -day_header_size 2 -day_header_bgcolor "#666666" -calendar_width "100%" - -day_bgcolor "#DDDDDD" - -today_bgcolor "#DDDDDD" + -day_bgcolor "#DCDCDC" + -today_bgcolor "#FFF8DC" -day_text_color "white" -empty_bgcolor "white" -next_week_template "" @@ -52,10 +52,29 @@ # Loop through the days of the week set julian $sunday_julian - set return_html " -
- \n" + set return_html "
\n" + # Navigation Bar + append return_html " + " + + append return_html " +
+ + + + +
+ < + + + April 21, 2002 - April 27, 2002 + + + > +
+ " + set days_of_week {Sunday Monday Tuesday Wednesday Thursday Friday Saturday} foreach day $days_of_week { @@ -65,21 +84,45 @@ set pretty_date [util_AnsiDatetoPrettyDate $date] set day_html [subst $day_template] - append return_html " - + + + " + + append return_html "\n" incr julian } @@ -107,7 +150,7 @@ -header_text_size "+2" -calendar_width "100%" -day_bgcolor "#DDDDDD" - -today_bgcolor "#DDDDDD" + -today_bgcolor "yellow" -day_text_color "white" -empty_bgcolor "white" -overlap_p 0 @@ -247,3 +290,43 @@ return $return_html } + + + +# +# Additional Utility Procs +# + +ad_proc dt_midnight_p { + time +} { + check if a time is midnight +} { + if {$time == "00:00" || $time == ""} { + return 1 + } + + if {[regexp {00:00 *[aA][mM]} $time the_match]} { + return 1 + } + + if {[regexp {12:00 *[aA][mM]} $time the_match]} { + return 1 + } + + return 0 +} + +ad_proc dt_no_time_p { + {-start_time:required} + {-end_time:required} +} { + This decides whether an item is without a time +} { + # Compare times and make sure it's midnight on both + if {[dt_midnight_p $start_time] && [dt_midnight_p $end_time]} { + return 1 + } else { + return 0 + } +}
$day_html
 " - + if {$date == $current_date} { + set bgcolor $today_bgcolor + } else { + set bgcolor $day_bgcolor + } + + append return_html "
$day_html   + + Add Item + +
+ " + # Go through events while {1} { set index [ns_set find $calendar_details $julian] if {$index == -1} { break } - append return_html "[ns_set value $calendar_details $index]
\n" + append return_html " + + + + " ns_set delete $calendar_details $index } + append return_html "
+ + [ns_set value $calendar_details $index] + +