Avoid warning if empty posted date (#1450)

This commit is contained in:
Christophe Maudoux 2018-06-22 19:33:38 +02:00
parent 6e9256122f
commit d5b146c223

View File

@ -269,11 +269,18 @@ sub newNotification {
}
# Set default date value
$self->logger->debug(
"Posted datas : uid = $json->{uid} - Date = $json->{date} - Ref = $json->{reference}"
);
my $dDate = strftime( "%Y-%m-%d", localtime() );
$json->{date} ||= $dDate;
if ( $json->{date} ) {
$self->logger->debug(
"Posted datas : uid = $json->{uid} - Ref = $json->{reference} - Date = $json->{date}"
);
}
else {
$self->logger->debug(
"Posted datas : uid = $json->{uid} - Ref = $json->{reference} - Date = ???"
);
$json->{date} = $dDate;
}
# Check if posted date > today
unless ( $json->{date} ge $dDate ) {