Index: openacs-4/packages/lab-report/tcl/lab-report-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lab-report/tcl/lab-report-procs.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/lab-report/tcl/lab-report-procs.tcl 21 Aug 2006 23:25:15 -0000 1.3 +++ openacs-4/packages/lab-report/tcl/lab-report-procs.tcl 24 Aug 2006 10:56:28 -0000 1.4 @@ -95,4 +95,26 @@ } { return [group::member_p -user_id $user_id \ -group_id [lab_report_central::instructor_group_id]] -} \ No newline at end of file +} + +ad_proc -private lab_report::within_date_bounds_p { + -now_date:required + -start_date:required + -end_date:required +} { + Checks if now_date is between start_date and end_date inclusive. + + @param now_date The current date. + @param start_date Lower bound. + @param end_date Upper bound. + + @return Returns 1 if now_date is between date bounds, otherwise 0 is + returned. +} { + set within_date_bounds_p 0 + if { $now_date >= $start_date && $now_date <= $end_date } { + set within_date_bounds_p 1 + } + + return $within_date_bounds_p +}