Dialogflow is accepting wrong date

Whenever I enter 37th June as an input it doesn't give error rather it considers the date as 30th June. What I want to do is to create an error prompt whenever 37th June is entered.

I am using @sys.date on a very simple intent which does nothing but accepts date parameter.

Upvotes: 3

Views: 350

Answers (1)

jonnycraze
jonnycraze

Reputation: 498

If you are using dialogflow and the nodejs fulfillment you could include moment and do some date validation quickly on your own:

moment(dateUserEnteredHere).isValid();

Upvotes: 1

Related Questions