AdaptiveCards icon indicating copy to clipboard operation
AdaptiveCards copied to clipboard

Input.Date value is not recognized on Spanish in Microsoft Teams

Open denikqwerty opened this issue 7 years ago • 13 comments

Hi. I`m using Bot Framework v4 together with Microsoft Teams as a channel. I have a case when I need to show adaptive card to the user for date selection. Everything works fine for the English users (MS Teams Settings Language is English), but not for the Spanish ones.

When you change the language in MS Teams the calendar is changed also, so instead of Apr. 9, 2019 i see 9 abr. 2019. After Submit of adaptive card - Activity.Value is empty...all I have is the Locale = es, but not the value.

How can I resolve this problem?

denikqwerty avatar Apr 09 '19 10:04 denikqwerty

Hi denikqwerty: Thanks for reporting this issue; We will investigate. Also could you help specify what platform you are attempting to use this on? @matthidinger /@dclaux : Could you take help take a first pass? Do we not support localized Inputs?

shalinijoshi19 avatar Apr 09 '19 13:04 shalinijoshi19

@shalinijoshi19 Hi. Thank you for response. I`m using .NET Core

denikqwerty avatar Apr 12 '19 09:04 denikqwerty

@denikqwerty can you clarify what doesn't work?

  • Can you not set the Input.Date value on the server in your .NET code?
  • Or is it not possible for an end user to set a date in an Input.Date in Teams?

If the former, can you share your code? If the latter, this would be a question for the Teams folks; they override input controls (including the date picker) and we don't have control over what they're doing.

dclaux avatar Apr 12 '19 23:04 dclaux

Hi @dclaux

I`m showing the AdaptiveCard to the user, and I expect user to select the date:

var opts = new PromptOptions
                {
                    Prompt = new Activity
                    {
                        Type = ActivityTypes.Message,
                        Attachments = new List<Attachment>
                        {
                            new Attachment
                            {
                                ContentType = "application/vnd.microsoft.card.adaptive",
                                Content = new
                                {
                                    type = "AdaptiveCard",
                                    version = "1.0",
                                    lang = "en",
                                    body = new object[]
                                    {
                                        new
                                        {
                                            type = "TextBlock",
                                            text = "Enter the date"
                                        },
                                        new
                                        {
                                            type = "Input.Date",
                                            id = "StartDate",
                                            placeholder = "Enter the date",
                                            value = $"{DateTime.Now:yyyy-MM-dd}"
                                        }
                                    },
                                    actions = new object[]
                                    {
                                        new
                                        {
                                            type = "Action.Submit",
                                            title = "Submit"
                                        }
                                    }
                                }
                            }
                        }
                    },
                };
                return await stepContext.PromptAsync(StartDatePrompt, opts);

Bot is using MS Teams as a main channel. For all users AdaptiveCard is rendered correctly and users allowed to select the date. But in my code when I`m getting Activity back to the bot, the turnContext.Activity.Value is empty for non-English users. For English users it is ok, and the turnContext.Activity.Value contaings JObject with parameter StartDate and entered date.

denikqwerty avatar Apr 16 '19 11:04 denikqwerty

@denikqwerty, would you mind pasting in the JSON that gets output and that you are passing down to render in AdaptiveCards? Meanwhile we are also going to investigate trying to repro this at our end. Also what platform does this render in ? Thanks!

shalinijoshi19 avatar Apr 19 '19 16:04 shalinijoshi19

I got the same issue when selecting Chinese in Teams webapp.

tony-xia avatar Apr 20 '19 13:04 tony-xia

@matthidinger following up offline with Teams

shalinijoshi19 avatar Apr 22 '19 21:04 shalinijoshi19

@almedina-ms any update on investigation from our side at all? Are we able to repro this at our end ? We should try to understand the issue for 1.2 even if we move some of our globallization related fixes out to the next release.

shalinijoshi19 avatar Apr 29 '19 17:04 shalinijoshi19

I met the same issue in France and Deutsch, 2555

jessedemobot avatar May 08 '19 07:05 jessedemobot

This appears to be an issue with Teams. We are working with the Windows Globalization team and Teams (@jjustinms) to figure out a way forward.

Meanwhile, here's the snip from Ron from Windows globalization around the rootcause: ...issue is specific to Teams, which has an inherent problem picking up OS locale data changes.

Teams is built on Electron, which is basically Chromium, and Chromium carries its own version of ICU (an open source set of globalization APIs and data). When Teams first starts, the Electron ICU picks up the OS locale and caches it. If the OS locale data changes, the Electron ICU has no mechanism to pick that up, so it stays in the initial OS locale setting.

shalinijoshi19 avatar Jul 06 '19 00:07 shalinijoshi19

Related: https://github.com/OfficeDev/BotBuilder-MicrosoftTeams/issues/195

v-kydela avatar Nov 22 '19 21:11 v-kydela

This issue has been automatically marked as stale because it has not had any activity for 5 days.

ghost avatar Dec 13 '19 18:12 ghost

@almedina-ms - Has this been fixed?

v-kydela avatar Nov 06 '20 18:11 v-kydela