I am using IBM Watson Assistant and try to validate user input against time frames / spans. What function should I use?
I was using @sys-date.before(now())
method to validate the time frame between past and present of a user input, but it does now work for me. If I input now or today Watson Assistant still thinks it is a past...
@sys-date.before(now())
:
Looks "like you're trying to make a reservation in the past. Try again." true
$day it is
I expect if user inputs now or today to make reservations work, and if user inputs time in the past to response as
"like you're trying to make a reservation in the past. Try again."
The code snippet in question looks like this:
{ "context":
{ "day": "@sys-date" } }
{ "context":
{ "time": "<? @sys-time.reformatDateTime('h:mm a') ?>" } }