Search code examples
ibm-cloudibm-watsonwatson-assistant

IBM Watson Assistant: Function daysBetween (start, end) not working


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?


Solution

  • 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.