Botframework-sdk: Localized time-formats with Prompts.time()?

Created on 29 Sep 2017  Â·  3Comments  Â·  Source: microsoft/botframework-sdk

Bot Info

  • SDK Platform: Node.js
  • SDK Version:

Issue Description

1) In french, Prompts.time doesn't work with Aujourd’hui but works well with Aujourd'hui.

(the difference is in the characters ’ ' )

Unfortunately, the first version (Aujourd’hui) is suggested by default on ios 11.

2) In french, Prompts.time request a english format date (MM/DD/YYYY) instead of french format date (DD/MM/YYYY)

Could you fix this bug please ?

Thanks

Code Example

builder.Prompts.time(session, "...");

Reproduction Steps

  1. In French ("fr")
  2. builder.Prompts.time(session, "...");
  3. type 01/02/2017

Expected Behavior

results.response.resolution.start should be Wed Feb 01 2017

Actual Results

results.response.resolution.start is Mon Jan 02 2017

Most helpful comment

@nwhitmont I respectfully disagree. As stated in the docs Prompts.time() uses the Chrono library. Chrono allows input in other languages (see https://github.com/wanasit/chrono/tree/master/src/parsers).

Why is Prompts.time() not making use of these localizations which already exist and sit there ready to be used? For me this seems to be a flawed or incomplete inclusion of Chrono and I therefore would consider this a bug. A bug - I may add - that makes Prompts.time() completely useless for the vast majority of mankind.

All 3 comments

@jschristophe What version of botbuilder produces the error?

@jschristophe It's not a "bug", its just not a feature. Currently, Prompts.time() expects input to be in en-US format.

Feel free to submit a PR with the desired time localization capabilities. Contributions welcome!

@nwhitmont I respectfully disagree. As stated in the docs Prompts.time() uses the Chrono library. Chrono allows input in other languages (see https://github.com/wanasit/chrono/tree/master/src/parsers).

Why is Prompts.time() not making use of these localizations which already exist and sit there ready to be used? For me this seems to be a flawed or incomplete inclusion of Chrono and I therefore would consider this a bug. A bug - I may add - that makes Prompts.time() completely useless for the vast majority of mankind.

Was this page helpful?
0 / 5 - 0 ratings