Skip to content

Commit

Permalink
Merge pull request #1812 from metacpan/oalders/fix-changes-date-forma…
Browse files Browse the repository at this point in the history
…tting-warning

Fixes warning in Changes date formatter.
  • Loading branch information
haarg committed Nov 19, 2016
2 parents ed3e71c + f029933 commit 2dc7ce4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/MetaCPAN/Web/Model/API/Changes/Parser.pm
Expand Up @@ -46,16 +46,19 @@ sub parse {
$date = $1;
}

# handle localtime-like timestamps
# handle localtime-like timestamps
# May Tue 03 17:25:00 2005
# /changes/distribution/Catalyst-View-PSP
# XXX haarg is going to rip this out and replace it with something better.
elsif ( $note
=~ s{^\D{3}\s+(\D{3})\s+(\d{1,2})\s+([\d:]+)?\D*(\d{4})}{}
=~ s{^(\D{3})\s+(\D{3})\s+(\d{1,2})\s+([\d:]+)?\D*(\d{4})}{}
)
{
if ($3) {
if ($4) {

# unfortunately ignores TZ data
$date = sprintf( '%d-%02d-%02dT%sZ',
$4, $months{$1}, $2, $3 );
$5, $months{$1}, $3, $4 );
}
else {
$date
Expand Down

0 comments on commit 2dc7ce4

Please sign in to comment.