summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-11 17:44:18 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-11 17:44:18 +0000
commit6e268e145f7b871a93b59264a7aeeaf947d712be (patch)
tree1ee952c6bffc66c4e64a539353cb0923254a8fc9
parent086238f6d9e3217c77059aa3d802219bb2a17a17 (diff)
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
-rwxr-xr-xLedgerSMB/Form.pm14
1 files 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;
}