From b2bb45d878f009772ac460a1d3921b206d42811e Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 9 Sep 2022 09:37:10 +0100 Subject: [PATCH] improve sched readme --- apps/sched/README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/sched/README.md b/apps/sched/README.md index 8a7d1fc21..c874b5577 100644 --- a/apps/sched/README.md +++ b/apps/sched/README.md @@ -70,11 +70,21 @@ let alarm = require("sched").newDefaultAlarm(); // Get a new timer with default values let timer = require("sched").newDefaultTimer(); -// Add/update an existing alarm -require("sched").setAlarm("mytimer", { +// Add/update an existing alarm (using fields from the object shown above) +require("sched").setAlarm("mytimer", { // as a timer msg : "Wake up", timer : 10 * 60 * 1000 // 10 minutes }); +require("sched").setAlarm("myalarm", { // as an alarm + msg : "Wake up", + t : 9 * 3600000 // 9 o'clock (in ms) +}); +require("sched").setAlarm("mydayalarm", { // as an alarm on a date + msg : "Wake up", + date : "2022-04-04", + t : 9 * 3600000 // 9 o'clock (in ms) +}); + // Ensure the widget and alarm timer updates to schedule the new alarm properly require("sched").reload();