06/75: set up ids for times in the json output to be dates (one task at one date has only one value for duration in jtimer), minor properties change
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 fc44c09c7adab4e5597c382998feb595a5ba090d Author: servantie <servantie.c@gmail.com> Date: Wed May 18 17:33:52 2016 +0200 set up ids for times in the json output to be dates (one task at one date has only one value for duration in jtimer), minor properties change --- .../java/org/chorem/jtimer/entities/TimerTaskHelper.java | 8 +++----- .../ui/report/resources/TimerTaskUpdaterView.properties | 6 +----- .../report/resources/TimerTaskUpdaterView_fr.properties | 15 +-------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index fed5607..dd8d6c9 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -372,8 +372,6 @@ public class TimerTaskHelper { public static String getTimesAndCommentsJSON(TimerTask task, Date startDate, Date endDate) { String result = ""; SortedMap<Date, Long> dates = task.getAllDaysAndTimes().subMap(startDate, endDate); - //todo:deal with ids (currently a useless sequence) - int sequence = 0; if (dates.size() != 0) { result = result + "["; for (SortedMap.Entry<Date, Long> entry : dates.entrySet()) { @@ -381,8 +379,9 @@ public class TimerTaskHelper { //converting Date to LocalDate (to ease the .toString()) //deal with timezones ? LocalDate date = entry.getKey().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - - result = result + "{\"id\":\""+ sequence + "\",\"startDate\":\"" + date.toString() + "T00:00:00" + + String dateString = date.toString(); + //as jtimer has time entries only for a day, the id of the times will be the date in yyyy-mm-dd format + result = result + "{\"id\":\""+ dateString + "\",\"startDate\":\"" + dateString + "T00:00:00" + "\",\"duration\":" + Long.toString(entry.getValue()) + ",\"info\":\""; //adding comments (if there are any) if (getAnnotation(task, entry.getKey()).size() != 0) { @@ -393,7 +392,6 @@ public class TimerTaskHelper { result = result.substring(0, result.length()-1); } result = result + "\"},"; - ++sequence; } //deleting trailing ',' because of the loop result = result.substring(0, result.length()-1); diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties index 3837279..e3a30c1 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView.properties @@ -24,10 +24,7 @@ updateGeneral=General updateOptions=Options updateFrom=From : updateTo=To : -updateDaily=Daily -updateMonthly=Monthly -updateWeekly=Weekly -updateYearly=Yearly +updateAnnotations = Include annotations currentWeek.Action.icon = date_current.png currentWeek.Action.shortDescription = Current week @@ -35,7 +32,6 @@ currentWeek.Action.shortDescription = Current week previousWeek.Action.icon = date_previous.png previousWeek.Action.shortDescription = Previous week -updateAnnotations.text = Include annotations generateUpdate.Action.text = &Generate generateUpdate.Action.icon = applications-system.png diff --git a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties index 44943f0..169d5bd 100644 --- a/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties +++ b/src/main/resources/org/chorem/jtimer/ui/report/resources/TimerTaskUpdaterView_fr.properties @@ -25,17 +25,8 @@ updateGeneral=G\u00E9n\u00E9ral updateOptions=Options updateFrom=De : updateTo=\u00C0 : -updateDaily=Par jour -updateMonthly=Par mois -updateWeekly=Par semaine -updateYearly=Par ann\u00E9e -updateByProject=Par projet +updateAnnotations = Inclure les annotations -updateIncludeTime=Afficher les temps -updateAnnotationsTime=avec l'heure -updateIntermediateTotalTime=Ajout des temps totaux interm\u00E9diaires -updateProjects=Projets -updateProjectsList=Liste des projets currentWeek.Action.icon = date_current.png currentWeek.Action.shortDescription = Semaine courante @@ -43,10 +34,6 @@ currentWeek.Action.shortDescription = Semaine courante previousWeek.Action.icon = date_previous.png previousWeek.Action.shortDescription = Semaine pr\u00E9c\u00E9dente -updateAnnotations.Action.text = Inclure les annotations -updateAnnotations.Action.shortDescription = Inclure les annotations - -* generateUpdate.Action.text = &G\u00E9n\u00E9rer generateUpdate.Action.icon = applications-system.png -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm