diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-10-31 10:23:40 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-10-31 10:23:40 +0100 |
commit | 1d17cc2cb30c5ad9f419b7d619805e3823283acc (patch) | |
tree | 6911c2f099aa1e28a5300106fc238d1f1366a5bb | |
parent | a3f530aa7637f3be6c67653f63fbedb4d6bd16d3 (diff) | |
download | moa-id-spss-1d17cc2cb30c5ad9f419b7d619805e3823283acc.tar.gz moa-id-spss-1d17cc2cb30c5ad9f419b7d619805e3823283acc.tar.bz2 moa-id-spss-1d17cc2cb30c5ad9f419b7d619805e3823283acc.zip |
fix STORK DateFormat
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java | 1 | ||||
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java index dbc9faba6..a2e0965d4 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java @@ -491,6 +491,7 @@ public class DateTimeUtils { fmt = DateTimeFormat.forPattern("yyyyMMdd"); break; default: + fmt = DateTimeFormat.forPattern("yyyy-MM-dd"); break; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java index 021eaee37..88c0e3245 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java @@ -36,12 +36,17 @@ import eu.stork.peps.auth.commons.STORKStatusCode; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + import javassist.expr.Instanceof; /** @@ -132,9 +137,11 @@ public class MOAAttributeProvider { } private String getFormatedDateOfBirth() { - if (authData.getDateOfBirth() != null) - return authData.getFormatedDateOfBirth(); + if (authData.getDateOfBirth() != null) { + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + return fmt.format(authData.getDateOfBirth()); + } else return null; |