Загрузка видео...

Не удалось загрузить видео

На главную

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,870 просмотров • 3 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

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

Фото профиля Awa!s
Awa!s3 лет назад

Which software do you use for recording videos?

Фото профиля someone
someone3 лет назад

@theankurkedia check that out bro

Фото профиля n_oway
n_oway3 лет назад

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

Фото профиля Steve (Builder.io)
Steve (Builder.io)3 лет назад

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

Фото профиля Koray 😷
Koray 😷3 лет назад

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

Фото профиля Noah Vandervelden
Noah Vandervelden3 лет назад

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

Фото профиля RodAvi
RodAvi3 лет назад

Awesome tip Steve, thanks a lot. !!!

Фото профиля const name = 'David';
const name = 'David';3 лет назад

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.

Фото профиля AleqsBrujo
AleqsBrujo3 лет назад

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

Похожие видео