withinCalendar()

This function checks whether, a given timestamp (e.g. the due date of an issue) falls into a time frame defined in a JWT calendar specification.


Bash
withinCalendar(timestamp, calendarName, timeZone) #Output: Boolean


Examples

Assumption: A custom JWT calendar called "my_calendar" has been defined as follows:

MON - THU {
   08:00 - 15:00,
   16:00 - 19:30;
}
 
FRI {
    08:00 - 15:00;
}

Parser expression

Description

Bash
withinCalendar(2020/12/01 8:00, "my_calendar", LOCAL)


This example returns: 

true

December 1st of 2020 is a Tuesday.

Bash
withinCalendar(2020/12/01 17:00, "my_calendar", LOCAL)


This example returns: 

false

December 1st of 2020 is a Tuesday.

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

timestamp

number

The parameter must be valid timestamp. Usually this value is retrieved from a

field

(e.g. due date, created date).

calendarName

text

The name of the used

JWT calendar

.

timeZone

timezone

The time zone used for the calculation.

Output

This function returns a boolean


Variant of the function where you can define an additional JWT calendar specification.


Bash
withinCalendar(timestamp, calendarName, additionalSpecifier, timeZone) #Output: Boolean


Examples

Assumption: A custom JWT calendar called "my_calendar" has been defined as follows:

MON - THU {
   08:00 - 15:00,
   16:00 - 19:30;
}
 
FRI {
    08:00 - 15:00;
}

Parser expression

Description

Bash
withinCalendar(2020/12/04 9:00, "my_calendar", "2020/12/04 {;}", LOCAL)


This example returns: 

false

The additional specifier {;} excludes December 4th from the calendar.

Additional information

Parameters used in this function:

Parameter

Input(data type)

Description

timestamp

number

The parameter must be valid timestamp. Usually this value is retrieved from a

field

(e.g. due date, created date).

calendarName

text

The name of the used 

JWT calendar

.

additionalSpecifier

text

A text containing an additional 

JWT calendar specification

timeZone

timezone

The time zone used for the calculation.

Output

This function returns a boolean

This function is usually used in a validators or the conditional execution parameter of post functions.


📚 Use cases and examples