09-13-2011 01:43 AM - edited 03-14-2019 08:31 AM
Hi There!
Im using Jonathan Schulenberg sub_datetime.aef script which is an awesome script for grabbing
Timezone,currentTime,currentTimeInt date and dayofweek information.
I have implemented a script at a customer site using this logic and it works great!
But i bumped into a weakness in my solution that i wonder íf somebody can help out with!
For instance if i compare if a queue shall be open or closed by doing an IF on the following logic
If (currentTimeInt >= 070000 && currentTimeInt <= 180000) Then
True -> Goto CSQ-Step
False -> Goto ClosedPrompt, that works ok
But if i want to compare
If (currentTimeInt >= 070000 && currentTimeInt <= 010000) and trying to do same logic it fails....
because in some cases my customer want to keep a queue open to 010000 AM due to extend their support open hours!
The question is are there any built-in script method or function that can be used when do a compare on PM and AM times and then crossing dates. I
IF so this way you could have a fully controlled TOD/DayOfWeek where several application/scripts could use a common SQL DB for storing business hours, exceptions etc.
Somebody?!
rgds Mikael
09-13-2011 09:18 PM
surely you just need two clauses:
if (currentTimeInt <= 10000 || (currentTimeInt >= 70000 && currentTimeInt <= 240000))
watch out for days of the week. Monday is not going to be open between 12am and 1am, and Saturday is not going to have the second clause,
Regards,
Geoff
09-16-2011 04:29 AM
Hi Geof!!
Thx. for you reply! I shall test this since i already check weekday-numbers in my logic!
Just a thought normally i think the CurrentimeInt returns 010000 (when 01:00 am) so i guess you mean that i shall
read a Substring of 010000 i.e dig out 10000 from the variable, right?!
Are there any other ways to do it with T[now] functionality or so?
rgds, Mikael
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide