# HG changeset patch # User Tim Englich # Date 1253547007 0 # Node ID 2f1b87e1a40c7f43af1aa91c3c1dba32938d33c8 # Parent 9f2eaefe9dd4790ffc7eb01eef4db5bdc2757c19 Added formatted Date Handling in getString Method geo-backend/trunk@109 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9f2eaefe9dd4 -r 2f1b87e1a40c geo-backend/Changelog --- a/geo-backend/Changelog Mon Sep 21 11:41:33 2009 +0000 +++ b/geo-backend/Changelog Mon Sep 21 15:30:07 2009 +0000 @@ -1,3 +1,8 @@ +2009-09-21 Tim Englich + + * src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java: + Added formatted Date handling in getString Method + 2009-09-21 Tim Englich * src/test/ressources/QueryExecutorTestCase.properties Edited, diff -r 9f2eaefe9dd4 -r 2f1b87e1a40c geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Mon Sep 21 11:41:33 2009 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Mon Sep 21 15:30:07 2009 +0000 @@ -7,6 +7,8 @@ import java.util.GregorianCalendar; import java.util.HashMap; +import de.intevation.gnv.geobackend.util.DateUtils; + /** * Defaultimplementation of the Interface Result. * This Class stores the Attributevalues of one Result. @@ -83,7 +85,15 @@ * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String) */ public String getString(String columnName) { - return this.columnValues.get(columnName).toString(); + Object o = this.columnValues.get(columnName); + if(o instanceof Date){ + return DateUtils.getPatternedDateAmer((Date)o); + }else if (o instanceof GregorianCalendar){ + Date d = ((GregorianCalendar)o).getTime(); + return DateUtils.getPatternedDateAmer(d); + }else{ + return this.columnValues.get(columnName).toString(); + } } /**