IsoInstantTypeAdapter: Enable parsing of 'offset' date times in profile response
This commit is contained in:
parent
a336f6be89
commit
f500cc7ebf
|
@ -25,10 +25,21 @@ public class IsoInstantTypeAdapter extends TypeAdapter<Instant>{
|
||||||
in.nextNull();
|
in.nextNull();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
String nextString;
|
||||||
try {
|
try {
|
||||||
return DateTimeFormatter.ISO_INSTANT.parse(in.nextString(), Instant::from);
|
nextString = in.nextString();
|
||||||
}catch(DateTimeParseException x){
|
}catch(Exception e){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
return DateTimeFormatter.ISO_INSTANT.parse(nextString, Instant::from);
|
||||||
|
}catch(DateTimeParseException x){}
|
||||||
|
|
||||||
|
try{
|
||||||
|
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(nextString, Instant::from);
|
||||||
|
}catch(DateTimeParseException x){}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue