3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Ignore surrounding whitespace for integers in parsedate

This commit is contained in:
Pragmatic Software 2015-05-27 16:11:16 -07:00
parent 277b363310
commit 21cd76e99e

View File

@ -21,7 +21,7 @@ sub parsedate {
my $seconds = 0; my $seconds = 0;
foreach my $input (@inputs) { foreach my $input (@inputs) {
return -1 if $input =~ m/forever/i; return -1 if $input =~ m/forever/i;
$input .= ' seconds' if $input =~ m/^\d+$/; $input .= ' seconds' if $input =~ m/^\s*\d+\s*$/;
my $parse = Time::ParseDate::parsedate($input, NOW => $now); my $parse = Time::ParseDate::parsedate($input, NOW => $now);