From 070f3fa66facdbe617f895c8cbc46042aafffd80 Mon Sep 17 00:00:00 2001 From: danielegobbetti Date: Sat, 19 Dec 2015 20:26:43 +0100 Subject: [PATCH] Add further getters, converting the data to other units --- .../gadgetbridge/model/CalendarEvents.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/CalendarEvents.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/CalendarEvents.java index eeb6651de..61c5b7bac 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/CalendarEvents.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/CalendarEvents.java @@ -99,6 +99,10 @@ public class CalendarEvents { return begin; } + public int getBeginSeconds() { + return (int)(begin/1000); + } + public long getEnd() { return end; } @@ -107,6 +111,14 @@ public class CalendarEvents { return end - begin; } + public int getDurationSeconds() { + return (int)((getDuration())/1000); + } + + public short getDurationMinutes() { + return (short)(getDurationSeconds()/60); + } + public long getId() { return id;