question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Formatted date and time components

See original GitHub issue

Hey 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
domarkucommented, Oct 23, 2020

Hello! Can we close this, as it was introduced by https://github.com/contentful/forma-36/pull/584?

1reaction
m10lcommented, Jan 21, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found