Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove joda time dependency. #186

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ipp-v3-java-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
<artifactId>jaxb2-basics-runtime</artifactId>
<version>1.11.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
*******************************************************************************/
package com.intuit.sb.cdm.util.v3;


import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.annotation.adapters.XmlAdapter;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

/**
* Adapter for JAXB to bind xs:date type to java.util.Date rather than the
Expand All @@ -32,7 +31,8 @@ public class DateAdapter extends XmlAdapter<String, Date> {
private static final int lengthOfDateFmtYYYY_MM_DD = 10;
private static final String INVALIDDATE = "9999-12-31";
private static final String datePattern = "(19|20)\\d\\d([- /.])(0[1-9]|1[012])\\2(0[1-9]|[12][0-9]|3[01])";
private static final DateTimeFormatter formatter = ISODateTimeFormat.date();

private static final String DATE_FORMAT = "yyyy-MM-dd";

/**
* Unmarshal a Date.
Expand Down Expand Up @@ -76,7 +76,7 @@ public String marshal(Date value) {
return null;
}

return formatter.print(new DateTime(value));
return new SimpleDateFormat(DATE_FORMAT).format(value);

}

Expand Down