summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Form.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 02bd44aa..6dac3922 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -977,13 +977,13 @@ sub datetonum {
my $mm;
my $dd;
- if ( $myconfig->{dateformat} =~ /^yy/ ) {
+ if ( $date =~ /^\d{4}-\d\d-\d\d$/ ) {
( $yy, $mm, $dd ) = split /\D/, $date;
- }
- elsif ( $myconfig->{dateformat} =~ /^mm/ ) {
+ } if ( $myconfig->{dateformat} =~ /^yy/ ) {
+ ( $yy, $mm, $dd ) = split /\D/, $date;
+ } elsif ( $myconfig->{dateformat} =~ /^mm/ ) {
( $mm, $dd, $yy ) = split /\D/, $date;
- }
- elsif ( $myconfig->{dateformat} =~ /^dd/ ) {
+ } elsif ( $myconfig->{dateformat} =~ /^dd/ ) {
( $dd, $mm, $yy ) = split /\D/, $date;
}