Changeset 1744

Show
Ignore:
Timestamp:
10/14/06 14:09:40
Author:
miyagawa
Message:

* BIG CHANGE: don't set timezone in Plagger::Date->parse anymore.
* Load GuessTimeZoneByDate? in Bundle::Planet
* GuessTimeZoneByDate? doesn't do anything if DateTime?::TimeZone? < 0.51

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Date.pm

    r1743 r1744  
    2121 
    2222    my $dt = $module->parse_datetime($date) or return; 
    23  
    24     # If parsed datetime is floating, don't set timezone here. It should be "fixed" in caller plugins 
    25     unless ($dt->time_zone->is_floating) { 
    26         $dt->set_time_zone( Plagger->context->conf->{timezone} || 'local' ); 
    27     } 
    28  
    2923    bless $dt, $class; 
    3024} 
  • trunk/plagger/lib/Plagger/Plugin/Bundle/Planet.pm

    r1734 r1744  
    2222        module => 'Filter::HTMLScrubber', 
    2323        config => $self->conf->{scrubber} || {}, 
     24    }); 
     25 
     26    $context->load_plugin({ 
     27        module => 'Filter::GuessTimeZoneByDomain', 
    2428    }); 
    2529 
     
    143147=item Filter::HTMLScrubber 
    144148 
     149=item Filter::GuessTimeZoneByDomain 
     150 
    145151=item SmartFeed::All 
    146152 
  • trunk/plagger/lib/Plagger/Plugin/Filter/GuessTimeZoneByDomain.pm

    r1743 r1744  
    88sub register { 
    99    my($self, $context) = @_; 
     10 
     11    unless (DateTime::TimeZone->can('names_in_country')) { 
     12        $context->log(error => 'DateTime::TimeZone >= 0.51 is required.'); 
     13        return; 
     14    } 
     15 
    1016    $context->register_hook( 
    1117        $self,