This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 3708b2b523cc7e5c5c9fc9b96ae433839a2d83c9 Author: servantie <servantie.c@gmail.com> Date: Wed May 18 09:53:29 2016 +0200 corrected method for getting times that was ignoring the date parameters and always sending all the times of a task --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index b6c05f4..7b54efc 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -358,7 +358,7 @@ public class TimerTaskHelper { public static String taskToJSONFormat(TimerTask task, Date startDate, Date endDate) { //todo : change id with something else ? String taskID = Integer.toString(task.getNumber()); - String resultingJSON = "{\"uuid\":\"" + task.getName()+ "\",\"periods\":" + getTimesAndCommentsJSON(task, startDate, endDate) +"}"; + String resultingJSON = "{\"URL\":\"" + task.getSynchronisingURL()+ "\",\"periods\":" + getTimesAndCommentsJSON(task, startDate, endDate) +"}"; return resultingJSON; } @@ -376,10 +376,9 @@ public class TimerTaskHelper { SortedMap<Date, Long> dates = task.getAllDaysAndTimes().subMap(startDate, endDate); //todo:deal with ids (currently a useless sequence) int sequence = 0; - if (task.getAllDaysAndTimes().size() != 0) { + if (dates.size() != 0) { result = result + "["; - SortedMap<Date, Long> timesMap = task.allDaysTimes; - for (SortedMap.Entry<Date, Long> entry : timesMap.entrySet()) { + for (SortedMap.Entry<Date, Long> entry : dates.entrySet()) { //adding id, startDate and duration //converting Date to LocalDate (to ease the .toString()) //todo:deal with timezones ? @@ -400,6 +399,9 @@ public class TimerTaskHelper { result = result.substring(0, result.length()-1); result = result + "]"; } + else { + result ="[]"; + } return result; } } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.