Skip Menu |

This queue is for tickets about the HTML-FormFu CPAN distribution.

Report information
The Basics
Id: 59157
Status: resolved
Priority: 0/
Queue: HTML-FormFu

People
Owner: Nobody in particular
Requestors: raherh [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.06001
  • 0.07000
  • 0.07001
  • 0.07002
Fixed in: (no value)



Subject: time_zone with DateTime element
DateTime element does not honour hours with respect to local time zone. It was discussed in the mailing list of 25 - 31 March. The latest version behaves same as 0.06001. Included are patches for Element/Date.pm and date_default_datetime_args.t. Time zone of DateTime::Format::Natural object must be set during its creation not after in Element/Date.pm. Thank you. Radek
Subject: Date.pm.patch
--- Date.pm Wed Jul 7 11:36:10 2010 +++ Date.pmnew Wed Jul 7 11:30:44 2010 @@ -153,8 +153,18 @@ my $default; if ( defined( $default = $self->default_natural ) ) { - my $parser = DateTime::Format::Natural->new; - $default = $parser->parse_datetime($default); + my $parser; + if ( defined( my $datetime_args = $self->default_datetime_args ) ) { + if (defined$$datetime_args{set_time_zone}) { + my $tz = $$datetime_args{set_time_zone}; + $parser = DateTime::Format::Natural->new(time_zone => $tz); + } else { + $parser = DateTime::Format::Natural->new(); + } + } else { + $parser = DateTime::Format::Natural->new(); + } + $default = $parser->parse_datetime($default); } elsif ( defined( $default = $self->default ) && length $default ) {
Subject: date_default_datetime_args.t.patch
--- date_default_datetime_args.t Wed Jul 7 11:45:53 2010 +++ date_default_datetime_args.tnew Wed Jul 7 11:40:13 2010 @@ -13,7 +13,9 @@ $form->process; { - my $dt = DateTime->now(time_zone => 'Europe/Berlin'); + my $parser = DateTime::Format::Natural->new; + my $dt = $parser->parse_datetime( 'now' ); + $dt->set_time_zone( 'Europe/Berlin' ); my $foo = $form->get_field('foo');
Sorry for not managing to look at this before now. It looks like this was already resolved in svn (r1723). I've just uploaded a new release today which includes the fix. Cheers, Carl