Input.Date value is not recognized on Spanish in Microsoft Teams
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?
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 Hi. Thank you for response. I`m using .NET Core
@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.
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, 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!
I got the same issue when selecting Chinese in Teams webapp.
@matthidinger following up offline with Teams
@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.
I met the same issue in France and Deutsch, 2555
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:
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.
Related: https://github.com/OfficeDev/BotBuilder-MicrosoftTeams/issues/195
This issue has been automatically marked as stale because it has not had any activity for 5 days.
@almedina-ms - Has this been fixed?