microsoft / microsoft/AdaptiveCards
[Feature Request] "Friendly" date formatting option
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Problem Statement
I get frustrated when I can't format my adaptive cards to display a date/timestamp in "friendly" format ("3 days ago", "4 hours ago", "2 years ago") like SPO search results can.
Proposed solution
Add a FRIENDLY param which would format a DATE() or TIME() value in "friendly" format, localized to the viewer's time zone.
As an example:
{{DATE(2017-02-14T06:00:00Z, FRIENDLY)}} would display as "Over 5 years ago".
{{DATE(2022-03-31T8:25:00Z, FRIENDLY)}} would display as "15 hours ago" (assuming I was in PST).
Alternatives or Workarounds
Attempting to build a stacking series of $when statements based on the timestamp.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the DATE() and TIME() formatting implementation, then clarify supported platforms, viewer-time-zone behavior, localization rules, and the relative-time thresholds before defining tests for the examples in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100