From a100c5e672d8abc2e27046effd90fce5fd7d2968 Mon Sep 17 00:00:00 2001 From: jeffcheasey88 <66554203+jeffcheasey88@users.noreply.github.com> Date: Sat, 18 Mar 2023 23:09:04 +0100 Subject: [PATCH] Fix json, timestamp is now a String, it was include as native data (not recognise in javascript parser) --- src/be/jeffcheasey88/peeratcode/routes/ChapterElement.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/be/jeffcheasey88/peeratcode/routes/ChapterElement.java b/src/be/jeffcheasey88/peeratcode/routes/ChapterElement.java index 9823918..0f3794f 100644 --- a/src/be/jeffcheasey88/peeratcode/routes/ChapterElement.java +++ b/src/be/jeffcheasey88/peeratcode/routes/ChapterElement.java @@ -32,8 +32,8 @@ public class ChapterElement implements Response { JSONObject chapterJSON = new JSONObject(); chapterJSON.put("id", chapter.getId()); chapterJSON.put("name", chapter.getName()); - if (chapter.getStartDate() != null) chapterJSON.put("startDate", chapter.getStartDate()); - if (chapter.getEndDate() != null) chapterJSON.put("endDate", chapter.getEndDate()); + if (chapter.getStartDate() != null) chapterJSON.put("startDate", chapter.getStartDate().toString()); + if (chapter.getEndDate() != null) chapterJSON.put("endDate", chapter.getEndDate().toString()); JSONArray puzzles = new JSONArray(); for (Puzzle puzzle : chapter.getPuzzles()) { JSONObject puzzleJSON = new JSONObject();