mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-29 18:27:18 +00:00
fix removing due dates
This commit is contained in:
parent
f8b67cc25e
commit
aa6f898e1e
2 changed files with 10 additions and 1 deletions
|
|
@ -97,6 +97,7 @@ public class APIHelper implements ErrorHandler, Profiler {
|
|||
|
||||
//Exclusion stratety needed for DBFlow https://github.com/Raizlabs/DBFlow/issues/121
|
||||
Gson gson = new GsonBuilder()
|
||||
.serializeNulls()
|
||||
.setExclusionStrategies(new CheckListItemExcludeStrategy())
|
||||
.setExclusionStrategies(new ExclusionStrategy() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import java.util.TimeZone;
|
|||
/**
|
||||
* Created by viirus on 21/01/16.
|
||||
*/
|
||||
public class DateDeserializer implements JsonDeserializer<Date> {
|
||||
public class DateDeserializer implements JsonDeserializer<Date>, JsonSerializer<Date> {
|
||||
|
||||
private final DateFormat dateFormat;
|
||||
private final DateFormat alternativeFormat;
|
||||
|
|
@ -55,4 +55,12 @@ public class DateDeserializer implements JsonDeserializer<Date> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
if (src == null) {
|
||||
return new JsonPrimitive("");
|
||||
}
|
||||
return new JsonPrimitive(this.dateFormat.format(src));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue