Intl.DateTimeFormat() formats the result with extra characters

By design Issue #13640778

Details

Author
Philipp S.
Created
Sep 8, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

Reduction is here: https://jsfiddle.net/ztvucdna/ 

In order to see the characters, you can copy the output (either from the div or from the console) and paste into a binary editor or whatever. 

Result from Edge:  ?12?/?19?/?2012
Result from Chrome: 12/19/2012

Steps to reproduce:
from selenium import webdriver
driver = webdriver.Edge()
driver.get(‘https://formatjs.io/react/v1/#formatted-date’)
elements = driver.find_elements_by_class_name(‘react-output’):

Actual:
elements[4].text
Out[41]: u’\u200eSeptember\u200e \u200e8\u200e, \u200e2017’

Expected:
elements[4].text
Out[46]: u’September 8, 2017’

IEDriver, Chrome driver, Gecko driver:
elements[4].text
Out[46]: u’September 8, 2017’

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

      Changed Assigned To to “edgedevtoolstri@microsoft.com”

      Changed Assigned To from “edgedevtoolstri@microsoft.com” to “John J.”

      Changed Status to “Confirmed”

      Changed Title from “Edge driver adds weird characters to Format js <FormattedDate>” to “Intl.DateTimeFormat() formats the result with extra characters”

      Changed Steps to Reproduce

      Changed Steps to Reproduce

      Changed Assigned To to “Ed M.”

      Changed Status from “Confirmed” to “By design”

    • Hello,

      Thank you for providing this information about the issue. Currently, we do not plan to release a fix for this problem. You can find more details at  https://github.com/Microsoft/ChakraCore/issues/599

      Best Wishes,
      The MS Edge Team

    • Extra characters with the hour:

      With Chrome et Firefox:

      the script:

      new Intl.DateTimeFormat('fr-FR', {hour: "2-digit", hour12: false}).format(new Date());
      

      returns:

      "10 h"
      

      With Edge 41:

      the script:

              new Intl.DateTimeFormat('fr-FR', {hour: "2-digit", hour12: false}).format(new Date());
      

      returns:

              "‎10‎:‎00"
      

      Extra characters with the minute:

      With Chrome and Firefox :

      the script :

      new Intl.DateTimeFormat('fr-FR', {minute: "2-digit"}).format(new Date());
      

      returns:
      “30”

      With Edge 41:

      the script:

      new Intl.DateTimeFormat('fr-FR', {minute: "2-digit"}).format(new Date());
      

      returns:

              "‎26‎/‎03‎/‎2018‎ ‎10‎:‎30‎:‎32"
      

      Extra characters with the second:

      With Chrome and Firefox :

      the script:

      new Intl.DateTimeFormat('fr-FR', {second: "2-digit"}).format(new Date());
      

      returns:
      “32”

      With Edge 41:

      the script:

      new Intl.DateTimeFormat('fr-FR', {second: "2-digit"}).format(new Date());
      

      returns:

              "‎26‎/‎03‎/‎2018‎ ‎10‎:‎30‎:‎32"
      

      Extra characters with the weekday:

      With Chrome and Firefox:

      the script:

      new Intl.DateTimeFormat('fr-FR', {weekday: "narrow"}).format(new Date()).replace(/[\u200e\u200f]/g, '');
      

      returns:

      "M".
      

      With Edge 41:

      the script:

      new Intl.DateTimeFormat('fr-FR', {weekday: "narrow"}).format(new Date()).replace(/[\u200e\u200f]/g, '');
      

      returns:

      "me"
      

    You need to sign in to your Microsoft account to add a comment.

    Sign in