Skip to content

Commit

Permalink
Fix HTTP date parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiencek committed Jan 8, 2015
1 parent 900d6a5 commit fa8bb94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Expand Up @@ -57,6 +57,7 @@ requires 'Hash::Merge' => '0.12';
requires 'HTML::FormHandler' => '0.40016';
requires 'HTML::Tiny' => '1.05';
requires 'HTML::TreeBuilder::XPath' => '0.14';
requires 'HTTP::Date' => '6.0';
requires 'IO::All' => '0.44';
requires 'JSON' => '2.59';
requires 'JSON::XS' => '2.32';
Expand Down
4 changes: 2 additions & 2 deletions lib/MusicBrainz/Server/Data/CritiqueBrainz.pm
@@ -1,8 +1,8 @@
package MusicBrainz::Server::Data::CritiqueBrainz;

use Moose;
use DateTime::Format::Natural;
use DBDefs;
use HTTP::Date qw( str2time );
use JSON;
use LWP::UserAgent;
use Text::Markdown qw( markdown );
Expand Down Expand Up @@ -67,7 +67,7 @@ sub _parse_review {

return Review->new(
id => $data->{id},
created => DateTime::Format::Natural->new->parse_datetime($data->{created}),
created => DateTime->from_epoch(epoch => str2time($data->{created})),
body => markdown($data->{text}),
author => User->new(id => $data->{user}{id}, name => $data->{user}{display_name})
);
Expand Down

0 comments on commit fa8bb94

Please sign in to comment.