Plagger::Plugin::Filter::FloatingDateTime
はてなダイアリーのRSSとかdc:dateが"YYYY-MM-DD"の場合、TimeZoneが決まらないのでfloatingになる。
Publish::Feedとか、Entryのsortとかでちょっと困るので、指定したtimezoneにfixするFilter Plugin書いた。
package Plagger::Plugin::Filter::FloatingDateTime;
use strict;
use base qw( Plagger::Plugin );
sub register {
my($self, $context) = @_;
$context->register_hook(
$self,
'update.entry.fixup' => \&update,
);
$self->{tz} = $context->conf->{timezone} || 'local';
}
sub update {
my($self, $context, $args) = @_;
$args->{entry}->date and $args->{entry}->date->time_zone->is_floating and
$args->{entry}->date->set_time_zone($self->{tz});
}
1;
Plagger::Plugin::Filter::FloatingDateTime
http://nomadscafe.jp/archives/plagger/FloatingDateTime.pm
PPF::TimeZoneはいろいろ考えすぎて意味が分からなげ。