Formatted date and time components
See original GitHub issueHey Forma 36 Fam ✌️
I’m proposing a package that will provide 3 components to format date and time absolute and relative following our guidelines: https://f36.contentful.com/guidelines/date-and-time/
The components would look something like this:
import { FormattedDate, FormattedRelativeDate, FormattedTime } from '@contentful/forma-36-react-formatted-date-time'
<FormattedDate date={new Date()} /> // 13 Aug 2019
<FormattedRelativeTime date={new Date()} /> // 4 hours ago, today, 2 days ago, 3 weeks ago, 4 months...
<FormattedTime date={new Date()} format="12" /> // 12pm
WDYT? Any feedback is much appreciated!
🖖
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Standard date and time format strings | Microsoft Learn
Defines the string that separates the year, month, and day components of a date. Defines the string that separates the hour, minute, and...
Read more >Date and Time Formats - W3C
This profile defines a restricted range of formats, all of which are valid ISO 8601 dates and times.
Read more >lightning-formatted-date-time - example - Salesforce Developers
Displays formatted date and time. Descriptor. lightning-formatted-date-time. Targets. Lightning Experience, Experience Builder Sites, Salesforce Mobile App, ...
Read more >Formatting and parsing date-time patterns - IBM
Formatting and parsing date-time patterns ; S · Millisecond, Number, 978 ; z, Time zone, General time zone, Pacific Standard Time; PST; GMT-08:00....
Read more >Time and Date Formats (PSPP) - GNU.org
6.7.4.5 Time and Date Formats · dd. Day of month, from 1 to 31. Always output as two digits. · mmm. Month. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello! Can we close this, as it was introduced by https://github.com/contentful/forma-36/pull/584?
Nice, a good addition. I’m in favor of keeping them as individual components rather than grouping into another package. So either individual components, or under
forma-36-react-components
if we have issues.