Handling Date in action

async def validate_time(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validates value of 'time' slot"""
    timeentity = get_entity_details(tracker, "time")
    parsedtime = timeentity and parse_duckling_time(timeentity)
    if not parsedtime:
        dispatcher.utter_message(template="utter_no_transactdate")
        return {"time": None}
    return parsedtime

Can I apply a logic to it that “if date is less than today” should throw an error that invalid date or time Can any one help out on this

Thanks in advance.

Hi @manoj_kumar,

You can use any python code to validate the slot value and then use dispatcher.utter_message like in your example to send a message to the user.

Hi @jjuzl,

Thanks for the reply.

And I tried applying a logic that if the date is less than today and gave dispatcher.utter_message(“Invalid Date”). But, it was taking any date and scheduling the payment

Could you explain me the process step-by-step please?

Thanks