using date subtraction in Xpath

6
I am working on an form that needs to display all tasks that have been closed in the last 30 days. This means I only want to see tasks that have been closed in the past 30 days. How can I subtract 30 days from the current Date in Xpath? sample Xpath: [Status != 'closed'][DueDate='[%CurrentDateTime%-30days]
asked
1 answers
34

In XPath it is possible to form so-called token expressions to add to or subtract from the current date. These expressions can be compared to an attribute of type DateTime.

Examples:

[Date >= '[%CurrentDateTime%] - 30 * [%DayLength%]']
[Date <= '[%BeginOfCurrentDay%] + 2 * [%WeekLength%]']

The topmost example seems to be the one you're after.

answered