Video wird geladen...
Video konnte nicht geladen werden
The `Intl` object in JS is so valuable, yet so underutilized Learn how to generate friendly relative time strings from a given date - like "in 10 minutes" or "last week" or "tomorrow" - with 0 dependencies in my latest blog post:
267,858 Aufrufe • vor 3 Jahren •via X (Twitter)
10 Kommentare

More of what you can do with `Intl.RelativeTimeFormat`, and some other super handy things you can do with `Intl`, in the full article:

Which software do you use for recording videos?

@theankurkedia check that out bro

nice one, the Spanish translation for the last one should be 'en 10 minutos' but seems to come back in English 🙃

doh, bad copy paste, will fix, thank you!

works good with money too. new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' } ).format(money);

Didn’t know how useful this was until working with currency in a recent project! Completely changed how I did currency, time, and a lot of other things Intl had to offer

Awesome tip Steve, thanks a lot. !!!

This is great. Thanks for this. I have a collection of utility functions I use that keep me from needing things like lodash. I'm currently using date-fns, but need to see if this might be near enough to remove that dependency as well.

I like your tips! Ty for the research and most important for sharing it<3
