Changeset 686

Show
Ignore:
Timestamp:
05/05/06 18:49:26
Author:
miyagawa
Message:
  • Fix BloglinesCitation? datetime as PST, then switch to local. Fixes #187
  • Plagger::Date->parse now doesn't force preference timezone if parsed datetime is floating. Use Filter::FloatingDateTime? if you want to fix it.
Files:

Legend:

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

    r556 r686  
    2121 
    2222    my $dt = $module->parse_datetime($date) or return; 
    23     if (my $context = Plagger->context) { 
    24         $dt->set_time_zone($context->conf->{timezone} || 'local'); 
     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' ); 
    2527    } 
    2628 
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/BloglinesCitations.pm

    r522 r686  
    7171        $data->{date} = Plagger::Date->strptime($date_format, $data->{date}); 
    7272 
     73        # This is a bit tricky: Bloglines Citation page returns datetime as Pacific Time as default 
     74        # Fix it first to PST to figure out the UTC date, then switch to Plagger's preference 
     75        $data->{date}->set_time_zone('America/Los_Angeles'); 
     76        $data->{date}->set_time_zone(Plagger->context->conf->{timezone} || 'local'); 
     77 
    7378        my $entry = Plagger::Entry->new; 
    7479        $entry->title($data->{title});