on 03-15-2021 6:49 AM
Hi Team,
We are using Datetime Gold Entity in one of our CAI requirements to capture a date.
The chatbot can be used both in US and UK regions where the users follow two different date formats MYD and DMY.
How does the bot understand that it's a MMDDYYYY or DDMMYYYY based on the user's login or location. Please suggest.
Thank you.
In order to do what you want, you would have to know where the user came from, or at least what date format they used. I don't see a way to know where they come from in the chatbot (no country, only language, UTC indicator), and therefore you would have to detect the user and check their preferences in your system.
If you could do that, then you could intercept the input and change it to the format you wanted (or interpret it as the format you wanted).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The DMY format has precedence. Only if that format is not able to parse a valid date, the MDY format is tried. As of now, the locale of the chat user is not taken into consideration.
E.g. the output for the two dates "12/01/1999" (valid DMY) and "13/01/1999" (invalid DMY) is
{
"confidence": 0.99,
"raw": "12/01/1999",
"iso": "1999-12-01T00:00:00+00:00",
"formatted": "Wednesday, 01 December 1999 at 12:00:00 AM (+0000)"
}
{
"confidence": 0.99,
"raw": "13/01/1999",
"iso": "1999-01-13T00:00:00+00:00",
"formatted": "Wednesday, 13 January 1999 at 12:00:00 AM (+0000)"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.