From f60abf9bf4c3e6d5b4b9e2871be24e0421e84917 Mon Sep 17 00:00:00 2001 From: Skriglitz Date: Tue, 23 Apr 2019 19:38:17 -0500 Subject: [PATCH] fix: added ISO format to prevent future crashes due to api date format changes --- src/main/java/com/mixer/api/util/gson/DateAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/mixer/api/util/gson/DateAdapter.java b/src/main/java/com/mixer/api/util/gson/DateAdapter.java index f2320d3..f063e8f 100644 --- a/src/main/java/com/mixer/api/util/gson/DateAdapter.java +++ b/src/main/java/com/mixer/api/util/gson/DateAdapter.java @@ -85,9 +85,10 @@ public DateAdapter(List formats, DateFormat defaultFormat) { public static DateAdapter v1() { DateFormat defaultFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); DateFormat newFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + DateFormat ISOFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); return new DateAdapter( - ImmutableList.of(defaultFormat, newFormat), + ImmutableList.of(defaultFormat, newFormat, ISOFormat), defaultFormat ); }