-
Notifications
You must be signed in to change notification settings - Fork 653
feat(datetime): add format_distance_to_now function #6615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6615 +/- ##
==========================================
- Coverage 94.54% 94.52% -0.02%
==========================================
Files 580 581 +1
Lines 43772 43797 +25
Branches 6480 6496 +16
==========================================
+ Hits 41384 41401 +17
- Misses 2345 2353 +8
Partials 43 43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
While I think this is kinda neat in general I think it opens a big can of worms concerning localization. |
I agree. I instead suggest adding an example snippet to |
I suggest closing this PR in favour of my suggestion above. |
I agree with @timreichen and @iuioiua . @fbritoferreira Thanks for your suggestion anyways Closing without merge |
This PR introduces the
formatDistanceToNow
function to the@std/datetime package
.The function formats a given Date object as a human-readable relative time string, such as "3 minutes ago" or "1 hour ago".