Fix json, timestamp is now a String, it was include as native data (not recognise in javascript parser)

This commit is contained in:
jeffcheasey88 2023-03-18 23:09:04 +01:00
parent 98e52aedd8
commit a100c5e672

View file

@ -32,8 +32,8 @@ public class ChapterElement implements Response {
JSONObject chapterJSON = new JSONObject(); JSONObject chapterJSON = new JSONObject();
chapterJSON.put("id", chapter.getId()); chapterJSON.put("id", chapter.getId());
chapterJSON.put("name", chapter.getName()); chapterJSON.put("name", chapter.getName());
if (chapter.getStartDate() != null) chapterJSON.put("startDate", chapter.getStartDate()); if (chapter.getStartDate() != null) chapterJSON.put("startDate", chapter.getStartDate().toString());
if (chapter.getEndDate() != null) chapterJSON.put("endDate", chapter.getEndDate()); if (chapter.getEndDate() != null) chapterJSON.put("endDate", chapter.getEndDate().toString());
JSONArray puzzles = new JSONArray(); JSONArray puzzles = new JSONArray();
for (Puzzle puzzle : chapter.getPuzzles()) { for (Puzzle puzzle : chapter.getPuzzles()) {
JSONObject puzzleJSON = new JSONObject(); JSONObject puzzleJSON = new JSONObject();