Date Object - Avaya-CXI/virtual-agent-public GitHub Wiki

HOME / REFERENCE DOCUMENTATION / DATE OBJECT

When evaluating conditionals to match options, Virtual Agent allows you to access certain properties about time in order to create time dependent IVRs. All of these properties are in UTC time. Documentation for these properties/functions can be found here: https://developer.mozilla.org/en- US/docs/Web/JavaScript/Reference/Global_Objects/Date

All of these fields can be access in the conditional field by using DATE.properyName (i.e DATE.year) and all of these fields follow the documentation listed above besides the month property as well as the dayOfWeek property. Both of these properties get the string name of the value returned from the native date function. For example, DATE.monthNumeric will evaluate to 0 if it is January, 11 if it is December. However DATE.month will evaluate to January when it is January or December when it is December. Similarly for DATE.dayOfWeek, DATE.dayOfWeekNumeric will return 0 on Sunday and 6 on Saturday. However DATE.dayOfWeek will return Sunday on Sunday and Saturday on Saturday.


Date Property Native Date function in Javascript
year getUTCFullYear(); //2021
monthNumeric getUTCMonth(); //5 (0 = January)
month getUTCMonth(); //June
dayOfWeekNumeric getUTCDay(); //5 (0 = sunday)
dayOfWeek getUTCDay(); //Friday
dayOfMonthNumeric getUTCDate(); //25
timeOfDay toUTCString(); //Fri Jun 25 2021
timeOfDayISO toISOString(); //2021-06-25T17:01:28.223Z
hours getUTCHours(); //13 (military time)
minutes getUTCMinutes(); //if it is 1:07 then it will return 7
seconds getUTCSeconds(); //if it is 1:07:45 it will return 45
epoch getTime(); //Seconds since epoch

⚠️ The DATE Object is currently only accessible through the conditional expression editor, not the Integration or Prompt Fields.