Merge pull request #3722 from randyheydon/master

calendar: read events synchronized from Gadgetbridge
master
Rob Pilling 2025-02-03 19:03:57 +00:00 committed by GitHub
commit 88a74927e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View File

@ -19,3 +19,4 @@
Display Widgets in menus
0.17: Load holidays before events so the latter is not overpainted
0.18: Minor code improvements
0.19: Read events synchronized from Gadgetbridge

View File

@ -60,6 +60,12 @@ const loadEvents = () => {
date.setSeconds(time.s);
return {date: date, msg: a.msg, type: "e"};
}));
// all events synchronized from Gadgetbridge
events = events.concat((require("Storage").readJSON("android.calendar.json",1) || []).map(a => {
// timestamp is in seconds, Date requires milliseconds
const date = new Date(a.timestamp * 1000);
return {date: date, msg: a.title, type: "e"};
}));
};
const loadSettings = () => {
@ -221,8 +227,8 @@ const drawCalendar = function(date) {
}, []);
let i = 0;
g.setFont("8x12", fontSize);
for (y = 0; y < rowN - 1; y++) {
for (x = 0; x < colN; x++) {
for (let y = 0; y < rowN - 1; y++) {
for (let x = 0; x < colN; x++) {
i++;
const day = days[i];
const curMonth = day < 15 ? month+1 : day < 50 ? month-1 : month;

View File

@ -1,7 +1,7 @@
{
"id": "calendar",
"name": "Calendar",
"version": "0.18",
"version": "0.19",
"description": "Monthly calendar, displays holidays uploaded from the web interface and scheduled events.",
"icon": "calendar.png",
"screenshots": [{"url":"screenshot_calendar.png"}],