Skip to content

Commit

Permalink
bugfix: for the test-suite (and maybe some of our patched old pipelin…
Browse files Browse the repository at this point in the history
…es) we should support pre-2016 dates
  • Loading branch information
muffato committed Jan 4, 2017
1 parent 89fef56 commit 2162066
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,14 @@ sub _convert_to_datetime { # a private subroutine that can recover missing
} else {
my $curr_year = Time::Piece->new->year();

foreach my $candidate_year ($curr_year, $curr_year-1) {
my $years_back = 0;
while ($years_back < 28) { # The Gregorian calendar repeats every 28 years
my $candidate_year = $curr_year - $years_back;
my $datetime = Time::Piece->strptime("$yearless $candidate_year", '%b %d %T %Y');
if($datetime->wdayname eq $weekday) {
return $datetime->date.' '.$datetime->hms;
}
$years_back++;
}
}

Expand Down

0 comments on commit 2162066

Please sign in to comment.