Thanks for the explanation, Fred! That is super helpful!
I am currently testing the bot and it processes the date - but with errors. I have the following three questions here:
If I want to write a precondition that the date shall be between today and a day in the past, say 15.01.2015, do I write isAfter(2015-01-15) or isBefore(2015-01-15)?
If I want to write a precondition that the shall be between to dates in the past. How do I combine these two conditions?
Do I need to integrate an option, which has no date condition?
I have built a similar flow to answer your questions.
You would use .isAfter(2015-01-15), but that would not be sufficient. In order to ensure that the date in question is between the past date and today, you also have to restrict it with respect to future dates. In order to include “today” you would specify a range between the past date and “tomorrow”.
“After past Date, before tomorrow” contains: {simplifiedDate.isAfter(pastDate) && simplifiedDate.isBefore(tomorrow)}
Variable definitions for “pastDate” and “tomorrow” look like this:
In order to have a condition for two dates in the past, simply add another variable (e.g. pastDate2) similar to pastDate in my example but with a different date.
You may either want to add such an option and loop back to the bot asking for a date again, or, you may want to use re-visitable output nodes and/or a resume prompt for this. Find more information here.