From 7517bffe9cf402eaccbd6143487b90f4fc6256a9 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 5 May 2020 16:23:43 +0200 Subject: [PATCH] ZeTime: Fix calendar event time and date (still barely usable, since only one event is sent, plus sunrise and sunset) --- CHANGELOG.md | 1 + .../service/devices/zetime/ZeTimeDeviceSupport.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebcd5f4ca..c264a3541 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * ZeTime: Support rejecting calls * ZeTime: Try to fix weather conditions on newer firmwares * ZeTime: Fix could not synchronize calendar on connect +* ZeTime: Fix calendar event time and date (still barely usable, since only one event is sent, plus sunrise and sunset) * Allow set light/dark theme according to system settings (new default) #### Version 0.43.3 diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/zetime/ZeTimeDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/zetime/ZeTimeDeviceSupport.java index da992fca1..e8e49b6a8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/zetime/ZeTimeDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/zetime/ZeTimeDeviceSupport.java @@ -550,7 +550,7 @@ public class ZeTimeDeviceSupport extends AbstractBTLEDeviceSupport { public void onAddCalendarEvent(CalendarEventSpec calendarEventSpec) { Calendar time = GregorianCalendar.getInstance(); byte[] CalendarEvent = new byte[calendarEventSpec.title.getBytes(StandardCharsets.UTF_8).length + 16]; // 26 bytes for calendar and overhead - time.setTimeInMillis(calendarEventSpec.timestamp); + time.setTimeInMillis(calendarEventSpec.timestamp * 1000L); CalendarEvent[0] = ZeTimeConstants.CMD_PREAMBLE; CalendarEvent[1] = ZeTimeConstants.CMD_PUSH_CALENDAR_DAY; CalendarEvent[2] = ZeTimeConstants.CMD_SEND;