summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index 1ca1ec13..b754e8d0 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -589,13 +589,13 @@ sub date_to_number {
my ( $yy, $mm, $dd );
if ( $date && $date =~ /\D/ ) {
- if ( $myconfig->{dateformat} =~ /^yy/ ) {
+ if ( $date =~ /^\d{4}-\d\d-\d\d$/ ) {
( $yy, $mm, $dd ) = split /\D/, $date;
- }
- elsif ( $myconfig->{dateformat} =~ /^mm/ ) {
+ } elsif ( $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;
}
@@ -791,3 +791,4 @@ sub set {
1;
+