Hi all,
I wonder if somebody could help me, I am trying to set an alarm at a certain hour, the problem is that the clock vibrates only if the screen is on. I have tried this:
clock.granularity = "minutes";
const myLabel = document.getElementById("myLabel");
function procedimiento()
{
clock.ontick = (evt) => {
let today = evt.date;
let hours = today.getHours();
hours = util.zeroPad(hours);
let mins = util.zeroPad(today.getMinutes());
myLabel.text = `${hours}:${mins}`;
if(hours == 15 && mins == 28) {
vibration.start("ring");
}
}
}
setTimeout(procedimiento(), 5000);
Is there something I am not considering?
Thanks in advance to all of you.
Best Answer