3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 13:59:47 +01: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;
foreach my $input (@inputs) {
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);