I am trying to do an alert for testing for the javascript.
It is just time-based. The time parts work as they display text before.
I can’t seem to get the return function to work.
Once I get to work, I can do the others, I believe.
Here is my javascript
function bubble_fn_alarm(){return}
// Array to store selected alert times (in HH:MM format)
var selectedAlertTimes = [‘09:00’, ‘13:30’, ‘18:39’];
// Function to check and display alerts based on selected times
function checkAlerts() {
var currentTime = new Date();
var currentHour = currentTime.getHours();
var currentMinute = currentTime.getMinutes();
// Format current time as HH:MM
var formattedCurrentTime = (‘0’ + currentHour).slice(-2) + ‘:’ + (‘0’ + currentMinute).slice(-2);
// Check if the current time matches any selected alert time
if (selectedAlertTimes.includes(formattedCurrentTime)){bubble_fn_alarm()};
}
// Call the checkAlerts function every second
setInterval(checkAlerts, 1000);
Let me know if you need more info.
Total newbie