1

I've tried using the daysBetween (start, end) function in my bot. For some reason it's not working. The support documentation for IBM Watson Assistant said it supported the java.util.Date.

Maybe I'm not using it right. Could you guys give me an example how to use the daysBetween (start, end) function within the java.util.Date in the JSON dialog editor?

data_henrik
  • 16,724
  • 2
  • 28
  • 49
larry walker
  • 123
  • 6

1 Answers1

0

As per the documentation, "You can use standard methods of the java.util.Date class" https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-methods#dialog-methods-dates-java-util-date

daysBetween is not a standard method of java.util.Date

https://docs.oracle.com/javase/7/docs/api/java/util/Date.html

You can achieve this by written a Cloud Function and calling it from Watson Assistant.

  • Thank you for your answer. Would there be a tutorial to show me how that? – larry walker Aug 12 '19 at 13:19
  • You can check this thread. It has inputs as well as links with steps for implementation https://stackoverflow.com/questions/51357554/ibm-watson-conversation-ibm-cloud-functions-user-input-for-parameters – Niraj Prasad Aug 13 '19 at 06:36