XPath current date + 1

0
so I’m quite new to Mendix and with little coding experience, but I'm trying to create a simple app with lunch orders. so I managed to have a data view that shows the orders of today by using this XPath: [BaguetteType='Kylling' and BestiltDato >= '[%BeginOfCurrentDay%]' and  BestiltDato <= '[%EndOfCurrentDay%]']    but as we have to order the evening before I want it to show tomorrow's orders to have a simple overview of what to order before leaving the office.  so is there an easy way to do this?
asked
3 answers
2

You could create a variable and store your calculated dates in there. This variable can then be used in your xpath.

You could set up your variable like this:

addDays( '[%BeginOfCurrentDay%]' , -1)

This would result in the begin of yesterday.

answered
1

I would create a DateTime before the retrieve activity, to define the end of tomorrow, using the expression: addDays([%EndOfCurrentDay%],1)

 

[BaguetteType='Kylling'
and
BestiltDato >= '[%EndOfCurrentDay%]'

and

BestiltDato >=  $EndOfNextDay]

answered
0

Or you can use in xpah this:

 

BestiltDato >= '[%BeginOfCurrentDay%] - 1 * [%DayLength%]']

 

more here: https://docs.mendix.com/refguide/xpath-keywords-and-system-variables/

answered