Skip to main content

Hello,

 

How I can make a rule to appear a message if the time out of working hours( from 8 to 4)

Here’s one way of doing it.

 

Basically you grab the hour component from your date/time control and check to see if it’s earlier than 8 or after 16.  If it’s 16 you also need to check the minutes are not more than 0.

 

For ease of readability I’ve split it into 3 form variables.

 

Create an integer form variable called “Hour”:

convertToNumber(formatDate("Form].#Datetime],"HH"))

 

Create an integer form variable called “Minutes”:

 

convertToNumber(formatDate(sForm].cDatetime],"mm"))

 

Create a boolean form variable called “Outside work hours”:

ifElse(sForm].yHour]<8||sForm].yHour]>16,

    true,

ifElse(eForm]. Hour]==16&&pForm]. Minutes]>0,

    true,

false))

 

Now you can write a submit rule:

 


Hello,

 

from where I get 

eForm].]Datetime]

 


Hi - that would be whatever you named your date picker control on your form. 


thank you very much


Reply