botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Localized time-formats with Prompts.time()?

Open jschristophe opened this issue 9 years ago • 3 comments

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.

  1. 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

jschristophe avatar Sep 29 '17 06:09 jschristophe

@jschristophe What version of botbuilder produces the error?

nwhitmont avatar Oct 02 '17 22:10 nwhitmont

@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 avatar Oct 09 '17 23:10 nwhitmont

@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.

laidbackindustries avatar Oct 10 '17 08:10 laidbackindustries