[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonsearchcat.pm

raeburn raeburn at source.lon-capa.org
Tue Aug 25 21:29:48 EDT 2020


raeburn		Wed Aug 26 01:29:48 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonsearchcat.pm 
  Log:
  - For 2.11
    Backport 1.354
  
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.331.4.15 loncom/interface/lonsearchcat.pm:1.331.4.16
--- loncom/interface/lonsearchcat.pm:1.331.4.15	Tue Nov 15 20:45:19 2016
+++ loncom/interface/lonsearchcat.pm	Wed Aug 26 01:29:48 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.331.4.15 2016/11/15 20:45:19 raeburn Exp $
+# $Id: lonsearchcat.pm,v 1.331.4.16 2020/08/26 01:29:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1881,6 +1881,8 @@
             my (undef,undef,undef,$cbday,$cbmon,$cbyear) = localtime($cbefore);
             # Correct for year being relative to 1900
             $cayear+=1900; $cbyear+=1900;
+            # Correct month; localtime gives month 0..11 but MySQL expects 1..12
+            $camon++; $cbmon++;
             my $cquery=
                 '(creationdate BETWEEN '.
                 "'".$cayear.'-'.$camon.'-'.$caday."'".
@@ -1899,6 +1901,8 @@
             my (undef,undef,undef,$mbday,$mbmon,$mbyear) = localtime($mbefore);
             # Correct for year being relative to 1900
             $mayear+=1900; $mbyear+=1900;
+            # Correct month; localtime gives month 0..11 but MySQL expects 1..12
+            $mamon++; $mbmon++;
             my $mquery=
                 '(lastrevisiondate BETWEEN '.
                 "'".$mayear.'-'.$mamon.'-'.$maday."'".




More information about the LON-CAPA-cvs mailing list