Timer function: Time Range, does Not work for me

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
VEDRAN
 
 
Posts: 86
Joined: Tue Feb 09, 2021 9:54 am
Contact:

Timer function: Time Range, does Not work for me

Post 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
User avatar
Pablo
 
Posts: 23311
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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.
VEDRAN
 
 
Posts: 86
Joined: Tue Feb 09, 2021 9:54 am
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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.
User avatar
Pablo
 
Posts: 23311
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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
User avatar
wwonderfull
 
 
Posts: 1576
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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.
User avatar
Pablo
 
Posts: 23311
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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.
VEDRAN
 
 
Posts: 86
Joined: Tue Feb 09, 2021 9:54 am
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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();
   }
});
User avatar
Pablo
 
Posts: 23311
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Timer function: Time Range, does Not work for me

Post 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).
Post Reply