TT#23876 Format sms time as timestamp in conversations

Change-Id: Ic472bcfe29ac16231ca1c76c0965515f440631df
changes/28/16528/5
Irina Peshinskaya 8 years ago
parent 7709f541bf
commit 46c02edf7f

@ -776,20 +776,23 @@ sub process_hal_resource {
$resource->{folder} = pop @p;
}elsif('sms' eq $item->{type}){
$resource = $item_accessors_hash;
$resource->{start_time} = NGCP::Panel::Utils::DateTime::from_string($item_mock_obj->timestamp)->epoch;
}elsif('xmpp' eq $item->{type}){
$resource = $item_accessors_hash;
}
$resource->{start_time} //= $item_mock_obj->timestamp;
my $datetime_fmt = DateTime::Format::Strptime->new(
pattern => '%F %T',
);
my $timestamp = NGCP::Panel::Utils::DateTime::epoch_local($resource->{start_time});
#if($c->req->param('tz') && DateTime::TimeZone->is_valid_name($c->req->param('tz'))) {
# $timestamp->set_time_zone($c->req->param('tz'));
#}
$resource->{start_time} = $datetime_fmt->format_datetime($timestamp);
$resource->{start_time} .= '.' . $timestamp->millisecond if $timestamp->millisecond > 0.0;
$c->log->debug(Dumper($resource));
if($item_mock_obj->timestamp){
$resource->{start_time} //= $item_mock_obj->timestamp;
my $datetime_fmt = DateTime::Format::Strptime->new(
pattern => '%F %T',
);
my $timestamp = NGCP::Panel::Utils::DateTime::epoch_local($resource->{start_time});
#if($c->req->param('tz') && DateTime::TimeZone->is_valid_name($c->req->param('tz'))) {
# $timestamp->set_time_zone($c->req->param('tz'));
#}
$resource->{start_time} = $datetime_fmt->format_datetime($timestamp);
$resource->{start_time} .= '.' . $timestamp->millisecond if $timestamp->millisecond > 0.0;
}
return $resource;
}

Loading…
Cancel
Save