BusinessHour functions
#
getThe get function takes the businessHour Id as input and returns businessHour object for that id.
Syntax:
new NameSpace("businessHours").get(
Number
businessHourId);
Returns: Object
Example:
response= new NameSpace("businessHours").get(28);log response;
#
addHoursThe 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(
Object
businessHour,Number
hoursToBeAdded);
Returns: Number
Example:
response= new NameSpace("businessHours").get(28);response1= new NameSpace("businessHours").addHours(response,2);log response1; //1644915061000
#
addMinsThe 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(
Object
businessHour,Number
hoursToBeAdded);
Returns: Number
Example:
response= new NameSpace("businessHours").get(28);response1= new NameSpace("businessHours").addMins(response,30);log response1; //1645016188000
#
getHoursBetweenThe 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(
Object
businessHour,Number
fromTime,Number
endTime);
Returns: Number
Example:
response = new NameSpace("field").getHoursBetween(businessHour,fromTime,endTime);log response;
#
getMinsBetweenThe 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(
Object
businessHour,Number
fromTime,Number
endTime);
Returns: Number
Example:
response = new NameSpace("field").getMinsBetween(businessHour,fromTime,endTime);log response;