From 6e268e145f7b871a93b59264a7aeeaf947d712be Mon Sep 17 00:00:00 2001 From: tetragon Date: Thu, 11 Oct 2007 17:44:18 +0000 Subject: Fixing the real problem of 1811022. No problems with the defaults table. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1744 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 7489bdfe..e46d2022 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -1358,16 +1358,14 @@ sub datetonum { my ( $self, $myconfig, $date, $picture ) = @_; if ( $date && $date =~ /\D/ ) { - - if ( $myconfig->{dateformat} =~ /^yy/ ) { + if ( $date && $date =~ /^\d{4}-\d\d-\d\d$/ ) { + # SC: Handle standard form of YYYY-MM-DD ( $yy, $mm, $dd ) = split /\D/, $date; - } - - if ( $myconfig->{dateformat} =~ /^mm/ ) { + } elsif ( $myconfig->{dateformat} =~ /^yy/ ) { + ( $yy, $mm, $dd ) = split /\D/, $date; + } elsif ( $myconfig->{dateformat} =~ /^mm/ ) { ( $mm, $dd, $yy ) = split /\D/, $date; - } - - if ( $myconfig->{dateformat} =~ /^dd/ ) { + } elsif ( $myconfig->{dateformat} =~ /^dd/ ) { ( $dd, $mm, $yy ) = split /\D/, $date; } -- cgit v1.2.3