This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated queries to use the new QueryDate to assure correct date formats
- Loading branch information
Gyuri Grell
committed
Jan 12, 2017
1 parent
df327ed
commit 8bb27a9
Showing
12 changed files
with
202 additions
and
106 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
components/src/main/java/com/constantcontact/v2/QueryDate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.constantcontact.v2; | ||
|
||
import java.util.Date; | ||
|
||
import static com.constantcontact.v2.converter.jackson.JacksonConverterFactory.ISO_8601_DATE_FORMAT; | ||
|
||
/** | ||
* A date wrapper to Constant Contact API specific ISO-8601 date format for query parameters. | ||
*/ | ||
public class QueryDate { | ||
private final Date date; | ||
|
||
public QueryDate() { | ||
date = new Date(); | ||
} | ||
|
||
public QueryDate(long dateInMilliseconds) { | ||
date = new Date(dateInMilliseconds); | ||
} | ||
|
||
public QueryDate(Date date) { | ||
this.date = date; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return ISO_8601_DATE_FORMAT.format(date); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.