From dd3c971aaad8f78c9671890980aa80aa093db6fd Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 17 Feb 2008 09:09:33 +1300 Subject: [PATCH] Date format fix for serials irregularities. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../en/modules/serials/subscription-add.tmpl | 8 ++++---- serials/subscription-add.pl | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl index 05aee6ed1d..4626a63b72 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl @@ -95,8 +95,8 @@ var patternchoice = document.getElementById("numberpattern").value; display_table(0); break; case "5": - var d = new Date(document.f.firstacquidate.value); - var smonth = d.getMonth(); +// var d = new Date(document.f.firstacquidate.value); +// var smonth = d.getMonth(); document.f.add1.value=1; document.f.add2.value=1; document.f.add3.value=''; @@ -415,7 +415,7 @@ var textbox = ''; function irregularity_check(){ document.f.irreg_check.value = 1; // Irregularity button now pushed var periodicity = document.f.periodicity.value; - var rollover = document.f.issuesexpected1.value; + var rollover = document.f.issuesexpected1.value; if(document.f.whenmorethantemp2){ rollover = document.f.whenmorethantemp2.value; } @@ -926,7 +926,7 @@ window.onload = irregular_order();
  • - diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index f79a31ca8a..6142a4a459 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -55,20 +55,21 @@ my ($template, $loggedinuser, $cookie) my $weekarrayjs=''; my $count = 0; +# FIXME - This assumes first pub date of today(). +# You can't enter past-date irregularities. my ($year, $month, $day) = Today; my $firstday = Day_of_Year($year,$month,$day); my ($wkno,$yr) = Week_of_Year($year,$month,$day); # week starting monday my $weekno = $wkno; for(my $i=$firstday;$i<($firstday+365);$i=$i+7){ - $count = $i; - if($wkno > 52){$year++; $wkno=1;} - if($count>365){$count=$i-365;} - my ($y,$m,$d) = Add_Delta_Days(1,1,1,$i - 1); - + #$count = $i; + #if($wkno > 52){$year++; $wkno=1;} + #if($count>365){$count=$i-365;} + my ($y,$m,$d) = Add_Delta_Days($year,1,1,$i - 1); +#warn "$y-$m-$d"; #BUGFIX padding add_delta_days() date - my $output = sprintf("%04d-%02d-%02d",$y , $m, $d ); - - $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',"; + my $output = sprintf("%04d-%02d-%02d",$y , $m, $d ); + $weekarrayjs .= "'Wk $wkno: ". format_date($output) ."',"; $wkno++; } chop($weekarrayjs); -- 2.39.5