microsoft / microsoft/AdaptiveCards

[JS][Rendering] The DATE and TIME functions do not format according to the system's selected settings

Open
#6,367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Renderers
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Target Platforms

NodeJS

SDK Version

All

Application Name

Any app

Problem Description

In Webkit-based browsers (Chrome, Edge, Opera, and maybe Safari although I haven't tested) the JS function toLocaleDateTimeString doesn't honor the system's format settings (it does respect the selected language though). This in turn means the DATE and TIME functions (which use toLocaleDateTimeString under the covers) do not always format the way a user would expect.

Screenshots

No response

Card JSON
{
    "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.1",
    "body": [
        {
            "type": "TextBlock",
            "separator": true,
            "text": "{{DATE(2017-02-14T06:00:00Z, LONG)}}"
        }
    ]
}
Sample Code Language

No response

Sample Code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the DATE and TIME functions to the JavaScript toLocaleDateTimeString call described in the issue. Reproduce the Adaptive Card example in a WebKit-based browser with different system format settings, then verify that the rendered date and time honor those settings across the listed target browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.