src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl 1.17

1.17 2009/07/08 23:54:49 tdreszer
Don't show restriction dates if they are in the past.
Index: src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -b -B -U 4 -r1.16 -r1.17
--- src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl	25 Jun 2009 01:26:53 -0000	1.16
+++ src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl	8 Jul 2009 23:54:49 -0000	1.17
@@ -475,8 +475,20 @@
         }
         push(@tmp, "$_=" . $metaData{$_}) for (sort keys %metaData);
     }
     my $details = join("; ", @tmp);
+
+    # If releaseDate is in the past then don't bother showing it.
+    if(length($releaseDate) > 0) {
+        my ($YYYY,$MM,$DD) = split('-',$releaseDate);
+        my $then = timegm(0,0,0,$DD,$MM-1,$YYYY);
+        my $now = time();
+        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($now);
+        if($then -$now < 0) {
+            $releaseDate = "";
+        }
+    }
+
     #htmlTableRow(*OUT_FILE,$fileName,$file[2],$submitDate,$releaseDate,$details);
     push @rows, sortableHtmlRow(\@sortables,$fileName,$file[2],$submitDate,$releaseDate,$details);
 }
 sortAndPrintHtmlTableRows(*OUT_FILE,@rows);