'Adaptive Card Input.Date

How to Set Todays Date as Minimum value in Input.Date Action of Adaptive Card. When a user select date ,all Backdates & Previous dates need to be blocked and he can select only Dates after Today.

I used:-

                        "type": "Input.Date",
                        "label": "Date",
                        "id": "ipDate",
                        "isRequired": true,
                        "errorMessage": "Please enter Date",
                        "separator": true,
                        "min": "LocalTimestamp (Date(YYYY-MM-DD))"

Output But ,It is not Working.

Can anyone Guide what Expression should i use in Min Value???.

I want like this--> enter image description here



Solution 1:[1]

Try utcNow() function.

Here is example, minimal and default date is today. If you need some TimeSpan you can use addDays etc Check: https://docs.microsoft.com/en-us/azure/bot-service/adaptive-expressions/adaptive-expressions-prebuilt-functions?view=azure-bot-service-4.0#date-and-time-functions

{
    "id": "startDate",
    "type": "Input.Date",
    "value": "${substring(utcNow(),0,10)}",
    "min": "${substring(utcNow(),0,10)}",
    "errorMessage": "Date cannot be empty"
},

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bane