BusinessHour functions
get#
The get function takes the businessHour Id as input and returns businessHour object for that id.
Syntax:
new NameSpace("businessHours").get(
NumberbusinessHourId);
Returns: Object
Example:
response= new NameSpace("businessHours").get(28);log response;addHours#
The addHours function takes the businessHour object and hours to be added from current time to that as input and returns the added time in millis format.
Syntax:
new NameSpace("businessHours").addHours(
ObjectbusinessHour,NumberhoursToBeAdded);
Returns: Number
Example:
response= new NameSpace("businessHours").get(28);response1= new NameSpace("businessHours").addHours(response,2);log response1; //1644915061000addMins#
The addMins function takes the businessHour object and minutes to be added from current time as input and returns the added time in millis format.
Syntax:
new NameSpace("businessHours").addMins(
ObjectbusinessHour,NumberhoursToBeAdded);
Returns: Number
Example:
response= new NameSpace("businessHours").get(28);response1= new NameSpace("businessHours").addMins(response,30);log response1; //1645016188000getHoursBetween#
The getHoursBetween function takes the businessHour object, from time and end time in millis as input and returns how many hours business has been active.
Syntax:
new NameSpace("field").getHoursBetween(
ObjectbusinessHour,NumberfromTime,NumberendTime);
Returns: Number
Example:
response = new NameSpace("field").getHoursBetween(businessHour,fromTime,endTime);log response;getMinsBetween#
The getMinsBetween function takes the businessHour object, from time and end time in millis as input and returns how many minutes business has been active.
Syntax:
new NameSpace("field").getMinsBetween(
ObjectbusinessHour,NumberfromTime,NumberendTime);
Returns: Number
Example:
response = new NameSpace("field").getMinsBetween(businessHour,fromTime,endTime);log response;