fix bug and check day of week
parent
9f16ca2183
commit
085b58084c
|
|
@ -1,3 +1,3 @@
|
|||
0.01: New Widget!
|
||||
0.02: Fix calling null on draw
|
||||
0.03: Only vibrate during working hours
|
||||
0.03: Only vibrate during work
|
||||
|
|
@ -7,8 +7,11 @@ they don't interfere with currently-running apps */
|
|||
const look = 20 * 1000; // 20 seconds
|
||||
|
||||
buzz = _ => {
|
||||
const d = new Date();
|
||||
if (d >= 8 && d <= 17) { // run from 8 AM - 5 PM
|
||||
const date = new Date();
|
||||
const day = date.getDay();
|
||||
const hour = date.getHours();
|
||||
// buzz at work
|
||||
if (day <= 5 && hour >= 8 && hour <= 17) {
|
||||
Bangle.buzz().then(_ => {
|
||||
setTimeout(Bangle.buzz, look);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue