From: Tim Pope Date: Fri, 10 Sep 2004 02:30:04 +0000 (+0000) Subject: Tweaked next_class X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=commitdiff_plain;h=9cf1dcbadd9469ad7d9731ecafbb5acb12efe405 Tweaked next_class --- diff --git a/perl/sctweb b/perl/sctweb index 1fa76cb..d9f9eff 100755 --- a/perl/sctweb +++ b/perl/sctweb @@ -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));