From a47992e19ac7784f6fd01aa4aefda637091d265d Mon Sep 17 00:00:00 2001 From: Francois G Date: Sun, 19 Mar 2023 17:25:55 +0100 Subject: [PATCH] Fix json, timestamp is now a String, it was include as native data (not recognise in javascript parser) for all chapters list --- src/be/jeffcheasey88/peeratcode/routes/ChapterList.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java b/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java index 0fe79e6..a12e9d1 100644 --- a/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java +++ b/src/be/jeffcheasey88/peeratcode/routes/ChapterList.java @@ -34,8 +34,8 @@ public class ChapterList 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()); chaptersJSON.add(chapterJSON); } writer.write(chaptersJSON.toJSONString());