Page 1 of 1
Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 1:32 pm
by VEDRAN
Hi
I wanted to use Timer to show Dialog at a certain times during the day. Like when it is: Office After-Hours.
But it does not work for me. Can you check please?
DEMO:
https://easyupload.io/s4k12s
Also, I would like to ask if there is an option to start a Timer function at a certain times of day only, but using Select: Conditions?
DEMO:
https://easyupload.io/fmnlu6
Thanks
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 1:47 pm
by Pablo
The 'start time' should be lower than the 'end time'.
I would like to ask if there is an option to start a Timer function at a certain times of day only, but using Select: Conditions?
Sorry, there is no standard option for this.
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 2:39 pm
by VEDRAN
Pablo wrote: ↑Mon Dec 25, 2023 1:47 pm
The 'start time' should be lower than the 'end time'.
I don' understand this so good. So If my bussines hours are 9-21H, so I don't work from 21H untill the next day 9AM, and I want to show the Dialog when I am NOT working ONLY, what should I do?
How do I set it up? Do I then need two timers and what should I enter in each Timer?
Please help.
Thanks.
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 3:10 pm
by Pablo
Sorry, that will not work. It will only work for a time range on the same day.
The range is from 12:00:00 AM to 11:59:59 PM
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 3:30 pm
by wwonderfull
VEDRAN wrote: ↑Mon Dec 25, 2023 2:39 pm
Pablo wrote: ↑Mon Dec 25, 2023 1:47 pm
The 'start time' should be lower than the 'end time'.
I don' understand this so good. So If my bussines hours are 9-21H, so I don't work from 21H untill the next day 9AM, and I want to show the Dialog when I am NOT working ONLY, what should I do?
This is a bit complex so I think it may require custom codes to address a solution.
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 4:22 pm
by Pablo
Maybe you can reverse the logic?
Instead of showing a dialog when you're not working, instead hide the dialog when you are working.
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 5:12 pm
by VEDRAN
I found a bug in the extension that is causing the issue that I am facing.
In auto start option when timer checks the correct time on document load the endTime var is never set to the desired end time instead it was made to set the startTime
Code: Select all
document.addEventListener('DOMContentLoaded', function(event)
{
var startTime = new Date();
startTime.setHours(10, 0, 0);
var endTime = new Date();
startTime.setHours(20, 57, 8); // <-- See?
var currentTime = new Date();
if (currentTime >= startTime && currentTime <= endTime)
{
TimerStartTimer1();
}
});
Code: Select all
document.addEventListener('DOMContentLoaded', function(event)
{
var startTime = new Date();
startTime.setHours(10, 0, 0);
var endTime = new Date();
endTime.setHours(20, 57, 8); // <-- Has to be like this!
var currentTime = new Date();
if (currentTime >= startTime && currentTime <= endTime)
{
TimerStartTimer1();
}
});
Re: Timer function: Time Range, does Not work for me
Posted: Mon Dec 25, 2023 6:04 pm
by Pablo
load the endTime var is never set to the desired end time instead it was made to set the startTime
This has been fixed in the latest build (12/25/2023).