diff options
-rw-r--r-- | LedgerSMB/Form.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index ab85c326..48ef9c8f 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -966,7 +966,7 @@ Converts $date from the format $myconfig->{dateformat} to the format 'yyyymmdd'. If the year extracted is only two-digits, the year given is assumed to be in the range 2000-2099. -If $date does not contain any digits, datetonum does nothing. +If $date does not contain any non-digits, datetonum does nothing. $picture is ignored. @@ -976,6 +976,11 @@ sub datetonum { my ( $self, $myconfig, $date, $picture ) = @_; + if ($date =~ /^\d{4}-\d{2}-\d{2}$/){ + $date =~ s/-//; + return $date; + } + if ( $date && $date =~ /\D/ ) { my $yy; |