changeset 4770:28fa48986ae9

DateGuesser: Take current year modulo 100 if compare it with a two digit year value. Removed auto boxing.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 04 Jan 2013 15:55:45 +0100
parents 92a08725bc63
children e21acb4f5c62
files flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java	Fri Jan 04 15:46:33 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/utils/DateGuesser.java	Fri Jan 04 15:55:45 2013 +0100
@@ -216,9 +216,10 @@
             Calendar cal = Calendar.getInstance();
             String day   = m.group(1);
             String month = m.group(2);
-            String yearS  = m.group(3);
-            Integer year = Integer.parseInt(yearS);
-            if (year <= Calendar.getInstance().get(Calendar.YEAR)) {
+            String yearS = m.group(3);
+            int year = Integer.parseInt(yearS);
+
+            if (year <= cal.get(Calendar.YEAR) % 100) {
                 year += 2000;
             }
             else {

http://dive4elements.wald.intevation.org