Merge pull request #3722 from randyheydon/master
calendar: read events synchronized from Gadgetbridgemaster
commit
88a74927e0
|
|
@ -19,3 +19,4 @@
|
||||||
Display Widgets in menus
|
Display Widgets in menus
|
||||||
0.17: Load holidays before events so the latter is not overpainted
|
0.17: Load holidays before events so the latter is not overpainted
|
||||||
0.18: Minor code improvements
|
0.18: Minor code improvements
|
||||||
|
0.19: Read events synchronized from Gadgetbridge
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,12 @@ const loadEvents = () => {
|
||||||
date.setSeconds(time.s);
|
date.setSeconds(time.s);
|
||||||
return {date: date, msg: a.msg, type: "e"};
|
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 = () => {
|
const loadSettings = () => {
|
||||||
|
|
@ -221,8 +227,8 @@ const drawCalendar = function(date) {
|
||||||
}, []);
|
}, []);
|
||||||
let i = 0;
|
let i = 0;
|
||||||
g.setFont("8x12", fontSize);
|
g.setFont("8x12", fontSize);
|
||||||
for (y = 0; y < rowN - 1; y++) {
|
for (let y = 0; y < rowN - 1; y++) {
|
||||||
for (x = 0; x < colN; x++) {
|
for (let x = 0; x < colN; x++) {
|
||||||
i++;
|
i++;
|
||||||
const day = days[i];
|
const day = days[i];
|
||||||
const curMonth = day < 15 ? month+1 : day < 50 ? month-1 : month;
|
const curMonth = day < 15 ? month+1 : day < 50 ? month-1 : month;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "calendar",
|
"id": "calendar",
|
||||||
"name": "Calendar",
|
"name": "Calendar",
|
||||||
"version": "0.18",
|
"version": "0.19",
|
||||||
"description": "Monthly calendar, displays holidays uploaded from the web interface and scheduled events.",
|
"description": "Monthly calendar, displays holidays uploaded from the web interface and scheduled events.",
|
||||||
"icon": "calendar.png",
|
"icon": "calendar.png",
|
||||||
"screenshots": [{"url":"screenshot_calendar.png"}],
|
"screenshots": [{"url":"screenshot_calendar.png"}],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue