Skip to content

Commit 185a0ca

Browse files
authored
Merge pull request #25 from GEBIT/fix-dateformat-timezone
Properly set the date format to fix TZ issues in JIRA DVCS Connector
2 parents b77d119 + de83186 commit 185a0ca

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/java/com/dkaedv/glghproxy/Application.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
@SpringBootApplication
1313
public class Application extends SpringBootServletInitializer {
1414

15+
/**
16+
* The date format used by GitHub. No millis! JIRA DVCS Connector fails parsing
17+
* dates when we have millis, which results in the timezone not being applied.
18+
*/
19+
public static final String GITHUB_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
20+
1521
public static void main(String[] args) {
1622
System.setProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "true");
1723
SpringApplication.run(Application.class, args);
@@ -27,7 +33,7 @@ public Jackson2ObjectMapperBuilder jacksonBuilder() {
2733
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
2834
builder
2935
.indentOutput(true)
30-
.simpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
36+
.simpleDateFormat(GITHUB_DATE_FORMAT)
3137
.propertyNamingStrategy(new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy());
3238

3339
return builder;

0 commit comments

Comments
 (0)