Plagger/Plugin/Filter/ForceTimeZone.pm untested

filter: Statementstmt 0.0% 0 / 12 Branchbran n/a Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 30 CC 1 SCAR 6.9
CC
1
Cov
0%
register
2.0
update
2.0
BEGIN
2.0
CRAP 2.0
1 package Plagger::Plugin::Filter::ForceTimeZone;
2 use strict;
3 use base qw( Plagger::Plugin );
4  
5 sub register {
6 my($self, $context) = @_;
7 $context->register_hook(
8 $self,
9 'update.entry.fixup' => \&update,
10 );
11 $self->{tz} = $self->conf->{timezone} || $context->conf->{timezone} || 'local';
12 }
13  
14 sub update {
15 my($self, $context, $args) = @_;
16 $args->{entry}->date and
17 $args->{entry}->date->set_time_zone($self->{tz});
18 }
19  
20 1;
21 __END__