--- loncom/interface/lonhtmlcommon.pm 2005/06/18 17:23:25 1.109
+++ loncom/interface/lonhtmlcommon.pm 2005/08/05 18:14:40 1.111
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.109 2005/06/18 17:23:25 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.111 2005/08/05 18:14:40 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -100,7 +100,7 @@ sub store_recent {
my ($area,$name,$value)=@_;
my $file=&recent_filename($area);
my %recent=&Apache::lonnet::dump($file);
- if (scalar(keys(%recent))>10) {
+ if (scalar(keys(%recent))>20) {
# remove oldest value
my $oldest=time;
my $delkey='';
@@ -266,12 +266,15 @@ sub date_setter {
if (! defined($no_hh_mm_ss)) {
$no_hh_mm_ss = 0;
}
- if (! defined($currentvalue) || $currentvalue eq 'now') {
- unless ($includeempty) {
- $currentvalue = time;
- $wasdefined=0;
- } else {
+ if ($currentvalue eq 'now') {
+ $currentvalue=time;
+ }
+ if ((!defined($currentvalue)) || ($currentvalue eq '')) {
+ $wasdefined=0;
+ if ($includeempty) {
$currentvalue = 0;
+ } else {
+ $currentvalue = time;
}
}
# other potentially useful values: wkday,yrday,is_daylight_savings
@@ -282,9 +285,18 @@ sub date_setter {
$year += 1900;
}
unless ($wasdefined) {
- $sec=($defsec?$defsec:0);
- $min=($defmin?$defmin:0);
- $hour=($defhour?$defhour:0);
+ if (($defhour) || ($defmin) || ($defsec)) {
+ ($sec,$min,$hour,$mday,$month,$year,undef,undef,undef) =
+ localtime(time);
+ $year += 1900;
+ $sec=($defsec?$defsec:0);
+ $min=($defmin?$defmin:0);
+ $hour=($defhour?$defhour:0);
+ } elsif (!$includeempty) {
+ $sec=0;
+ $min=0;
+ $hour=0;
+ }
}
my $result = "\n\n";
$result .= <