dont buzz on sunday
parent
013685b01d
commit
cd4efcb577
|
|
@ -2,12 +2,13 @@
|
||||||
const move = 20 * 60 * 1000; // 20 minutes
|
const move = 20 * 60 * 1000; // 20 minutes
|
||||||
const look = 20 * 1000; // 20 seconds
|
const look = 20 * 1000; // 20 seconds
|
||||||
|
|
||||||
buzz = _ => {
|
const buzz = _ => {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const day = date.getDay();
|
const day = date.getDay();
|
||||||
const hour = date.getHours();
|
const hour = date.getHours();
|
||||||
// buzz at work
|
// buzz at work
|
||||||
if (day <= 5 && hour >= 8 && hour <= 17) {
|
if (day >= 1 && day <= 5 &&
|
||||||
|
hour >= 8 && hour <= 17) {
|
||||||
Bangle.buzz().then(_ => {
|
Bangle.buzz().then(_ => {
|
||||||
setTimeout(Bangle.buzz, look);
|
setTimeout(Bangle.buzz, look);
|
||||||
});
|
});
|
||||||
|
|
@ -15,4 +16,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
setInterval(buzz, move); // buzz to stand / sit
|
setInterval(buzz, move); // buzz to stand / sit
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue