Tweaked next_class
authorTim Pope <code@tpope.net>
Fri, 10 Sep 2004 02:30:04 +0000 (02:30 +0000)
committerTim Pope <code@tpope.net>
Fri, 10 Sep 2004 02:30:04 +0000 (02:30 +0000)
perl/sctweb

index 1fa76cbbc3019ab9bd5765a770df66eaeb5a3cee..d9f9eff52a9ccff739a8a20fc629455ad909d61b 100755 (executable)
@@ -56,7 +56,7 @@ sub next_class {
     my $days = Delta_Days($1,$2,$3,$4,$5,$6);
     my $firstday = Date::Calc->new($1,$2,$3);
     my $lastday = Date::Calc->new($4,$5,$6);
-    my $today = Date::Calc->today;
+    my $today = Date::Calc->new(Date::Calc->localtime(time+3600*6)->date);
     my @days=();
     foreach(split(" ",$class{'days'})) {
        push @days, Decode_Day_of_Week($_);
@@ -67,7 +67,7 @@ sub next_class {
        next if(grep($_ == $today, @off));
        return $today;
     }
-    $today = Date::Calc->today;
+    $today = Date::Calc->new(Date::Calc->gmtime->date);
     for($today = ($today < $lastday ? $today : $lastday); $today > $firstday; $today--) {
        next unless(grep($_ == Day_of_Week($today->date), @days));
        next if(grep($_ == $today, @off));