20 |
my $class = shift; |
my $class = shift; |
21 |
my $self = bless {}, $class; |
my $self = bless {}, $class; |
22 |
$self->{fmt2str} = Message::Util::make_clone |
$self->{fmt2str} = Message::Util::make_clone |
23 |
($Message::Field::Date::DEFAULT{-fmt2str}); |
(\%Message::Field::Date::FMT2STR); |
24 |
$self; |
$self; |
25 |
} |
} |
26 |
|
|
151 |
-fill_date => 0, |
-fill_date => 0, |
152 |
-fill_msgid => 0, |
-fill_msgid => 0, |
153 |
-fill_ua_name => 'x-shimbun-agent', |
-fill_ua_name => 'x-shimbun-agent', |
154 |
|
-format => 'news-usefor', |
155 |
-parse_all => 1, |
-parse_all => 1, |
156 |
; |
; |
157 |
my $hdr = $msg->header; |
my $hdr = $msg->header; |
200 |
if ($p{base_uri} && /uri/ && length $p{$_}) { |
if ($p{base_uri} && /uri/ && length $p{$_}) { |
201 |
require URI::WithBase; |
require URI::WithBase; |
202 |
$a->add ($name => URI::WithBase->new ($p{$_}, $p{base_uri})->abs); |
$a->add ($name => URI::WithBase->new ($p{$_}, $p{base_uri})->abs); |
203 |
|
} elsif (/color/) { |
204 |
|
$p{$_} = '#'.$p{$_} if $p{$_} =~ /^[A-Za-z0-9]{6}$/; |
205 |
|
$a->add ($name => $p{$_}) if length $p{$_}; |
206 |
} else { |
} else { |
207 |
$a->add ($name => $p{$_}) if length $p{$_}; |
$a->add ($name => $p{$_}) if length $p{$_}; |
208 |
} |
} |
224 |
$uri->display_name ($p{list_name}) if length $p{list_name}; |
$uri->display_name ($p{list_name}) if length $p{list_name}; |
225 |
} |
} |
226 |
if ($p{urn_template}) { |
if ($p{urn_template}) { |
227 |
my $urn = $self->Message::Field::Date::_date2str ({ |
my $urn = $date->stringify ( |
228 |
format_template => $p{urn_template}, |
-format_macros => $self->{fmt2str}, |
229 |
date_time => $date->unix_time, |
-format_template => $p{urn_template}, |
230 |
zone => $date->zone, |
-format_parameters => \%p, |
231 |
fmt2str => $self->{fmt2str}, |
); |
232 |
}, \%p); |
#my $urn = $self->Message::Field::Date::_date2str ({ |
233 |
|
# format_template => $p{urn_template}, |
234 |
|
# date_time => $date->unix_time, |
235 |
|
# zone => $date->zone, |
236 |
|
# fmt2str => $self->{fmt2str}, |
237 |
|
#}, \%p); |
238 |
$hdr->add ('x-uri')->value ($urn); |
$hdr->add ('x-uri')->value ($urn); |
239 |
} |
} |
240 |
## Additional information |
## Additional information |