marcin wrote:
no to sorki ... nie skojarzyłem problema :) narka
dobrze że przypomniałeś, oto poprawka
Index: lms-payments =================================================================== RCS file: /cvsroot/lms/bin/lms-payments,v retrieving revision 1.102 diff -u -r1.102 lms-payments --- lms-payments 16 Jan 2008 23:50:04 -0000 1.102 +++ lms-payments 17 Jun 2008 09:47:09 -0000 @@ -139,6 +139,15 @@ } }
+sub is_leap_year($) +{ + my $year = shift; + return 0 if $year % 4; + return 1 if $year % 100; + return 0 if $year % 400; + return 1; +} + use constant CONTINUOUS => 6; use constant YEAR => 5; use constant QUARTER => 4; @@ -157,6 +166,11 @@ my $weekday = strftime("%u",localtime2()); my $yearday = strftime("%j",localtime2());
+# leap year fix +if(is_leap_year($year) && $yearday > 31+28) { + $yearday -= 1; +} + my $today; if($fakedate) { $today = $currtime;