Methods
dayInMonth(day)
Matches based on the calendar day in the month
Parameters:
Name | Type | Description |
---|---|---|
day |
int | the Day in the month, e.g. 11 for the 11th day of the month |
dayOfWeekInMonth(day, nth)
Matches based on the day of the week in the month.
Parameters:
Name | Type | Description |
---|---|---|
day |
int | the day of the week, 0=Sunday, 1=Monday, etc. |
nth |
int | If 1, it will match the first day (e.g. first Sunday) of the month, if 2 it will be the second, etc. |
intersectionOf(expr1, expr2)
Specifies an intersection of two expression. Only those days will match
this expression that match both (sub) expressions.
Parameters:
Name | Type | Description |
---|---|---|
expr1 |
Object | first expression |
expr2 |
Object | second expression |
months(months)
Match one or multiple months.
Parameters:
Name | Type | Description |
---|---|---|
months |
Array | array of integers specifying months to match. 0=January, 1=February, etc. |
negate(expr)
Specifies an expression that matches all days that do not match the
expression given.
Parameters:
Name | Type | Description |
---|---|---|
expr |
Object | The expression, created by one of the functions exported by TempEx. |
notOnSpecificDates(dates)
Specifies an expression that matches all days that are not in a list of
given days.
Parameters:
Name | Type | Description |
---|---|---|
dates |
Array | array of Date instances |
occurrences(expression, from, to)
Given a time interval (date range), determines all occurrences (days)
within the interval for the given expression.
Parameters:
Name | Type | Description |
---|---|---|
expression |
Object | An expression created by one of the factory functions |
from |
Date | start of time interval |
to |
Date | end of time interval |
once(when)
Specifies an expression that matches one particular day.
Parameters:
Name | Type | Description |
---|---|---|
when |
Date | = the day matched |
onOrAfter(firstDay)
Specifies an expression that matches a day and all days after that day.
Parameters:
Name | Type | Description |
---|---|---|
firstDay |
Date | The first day to match |
onOrBefore(lastDay)
Specifies an expression that matches all days up to and including lastDay.
Parameters:
Name | Type | Description |
---|---|---|
lastDay |
Date | last day to be matched. |
onWeekdays(days)
Specifies an expression that matches days in the week, e.g. Mondays and
Wednesday, but not all other week days.
Parameters:
Name | Type | Description |
---|---|---|
days |
Array | Array of integers describing the days of the week, e.g. [0, 2, 3] will represent Sundays, Tuesdays and Wednesdays |
union(expressions)
Matches the union of the expressions given: If any of the expressions
provided matches, then it is a match.
Parameters:
Name | Type | Description |
---|---|---|
expressions |
Array | array of expressions, as created by one of the factory functions of TempEx. |