Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

It's 2026. You don't need a library for formatting dates in JavaScript. Just use Intl 👇

148,678 görüntüleme • 10 ay önce •via X (Twitter)

36 Yorum

Asmir profil fotoğrafı
Asmir10 ay önce

@YBenlemlih For better performance, use

kkkooo profil fotoğrafı
kkkooo10 ay önce

@YBenlemlih It’s 2026, why not use Temporal🤨

Alexander Codes profil fotoğrafı
Alexander Codes10 ay önce

@YBenlemlih how do you make these code animations?

Josef Bender profil fotoğrafı
Josef Bender10 ay önce

👇

Alexander Codes profil fotoğrafı
Alexander Codes10 ay önce

@YBenlemlih thank you!

Kayvan Arianpour profil fotoğrafı
Kayvan Arianpour10 ay önce

@YBenlemlih Unfortunately JS does not handle the timezone issue well. If you don’t have this issue, good for you. I will wait for Temporal. Till then, still in 2026, I use date-fns

Lingo.dev profil fotoğrafı
Lingo.dev10 ay önce

@YBenlemlih That’s great news 👍

aymericzip profil fotoğrafı
aymericzip10 ay önce

@YBenlemlih I guess 2026 has to be formatted using Intl

Samador 🔥 profil fotoğrafı
Samador 🔥10 ay önce

@YBenlemlih There's 'toLocaleString()' which I believe you'll easily remember. Works the same as Intl

Yash Solanki profil fotoğrafı
Yash Solanki10 ay önce

@YBenlemlih but library still makes the job much easier. I use dayjs, and it works seamlessly i'l save this for the future, thanks!!

Ann Liao profil fotoğrafı
Ann Liao10 ay önce

@YBenlemlih What's the different between this and dayjs?

Anish B Ghosh profil fotoğrafı
Anish B Ghosh10 ay önce

@YBenlemlih javascript has so many hidden treasures. it's good to have a treasure hunter like you amongst us.

RubyWithoutRailsWithStaticTypes profil fotoğrafı
RubyWithoutRailsWithStaticTypes10 ay önce

@YBenlemlih Technically we never needed any libraries, even back in the jquery days. But JavaScript sucks on every level, and everyone desperately attempts to use band aids & duct tape

Ville Saukkonen profil fotoğrafı
Ville Saukkonen10 ay önce

@YBenlemlih Intlesting 🤔

Colin Richardson profil fotoğrafı
Colin Richardson10 ay önce

@YBenlemlih "You don't need a library".. except, you kinda do. Because, yes, you got the correct format.. but you got the wrong timezone.. 14:35:20Z is gonna be like 8:35AM for most of America right?

Cody profil fotoğrafı
Cody10 ay önce

@YBenlemlih i knew intl was the move years ago

Subhadip Mishra profil fotoğrafı
Subhadip Mishra10 ay önce

@YBenlemlih New update

Justin Schroeder profil fotoğrafı
Justin Schroeder10 ay önce

@YBenlemlih For more control and parsing:

Gamatek 🇫🇷 profil fotoğrafı
Gamatek 🇫🇷10 ay önce

@YBenlemlih same for time, number etc

Renato Carneiro profil fotoğrafı
Renato Carneiro10 ay önce

@YBenlemlih date-fns

Beka profil fotoğrafı
Beka10 ay önce

@YBenlemlih My AI agent already used this

Hamza Ahmad profil fotoğrafı
Hamza Ahmad10 ay önce

@YBenlemlih Absolutely!

Ankit Mohanta profil fotoğrafı
Ankit Mohanta10 ay önce

@YBenlemlih There are tons of npm packages that do the same thing and export their custom hooks and functions, but under the hood, they are using this exact utility

Sanchita profil fotoğrafı
Sanchita10 ay önce

@YBenlemlih

Romain profil fotoğrafı
Romain10 ay önce

@YBenlemlih Happened to me today : ki() is compiled name for Angular's formatDate() function. Silly us trying to format a string instead of a Date, but 1) it doesn't bother Angular as it still tries to cast to a Date then format 2) it was doing fine with "2025-12-23" soooo

Sevalla profil fotoğrafı
Sevalla10 ay önce

@YBenlemlih JS has some hidden gems.

Ypatios Chaniotakos profil fotoğrafı
Ypatios Chaniotakos10 ay önce

@YBenlemlih Cool

Andrii Shupta profil fotoğrafı
Andrii Shupta10 ay önce

@YBenlemlih In more complex apps, formatting is only ~10% and using Luxon (and other libs) gives better api and more functionality: timezones/offsets, add/remove days/minutes, startOf/endOf, from/to ISO, DateTime<isValid?>, etc

Adetunji | Software Engineer (Web & Mobile) profil fotoğrafı
Adetunji | Software Engineer (Web & Mobile)10 ay önce

@YBenlemlih This is so cool I learn it this year and never installed a library again

Habibur Rahman profil fotoğrafı
Habibur Rahman10 ay önce

@YBenlemlih I am happy that JS has this built-in but the DX of date-fns is way better

Hosein Hamzenejadi profil fotoğrafı
Hosein Hamzenejadi10 ay önce

@YBenlemlih I used to use moment.js Intl is much better and it's native

blank profil fotoğrafı
blank10 ay önce

@YBenlemlih I guess this is the end of the road for me with date-fns.

thym profil fotoğrafı
thym10 ay önce

@YBenlemlih cool animation!

tanav profil fotoğrafı
tanav10 ay önce

@YBenlemlih Crazy library

Glitchmon profil fotoğrafı
Glitchmon10 ay önce

@YBenlemlih Bro prepared the post for next year's algo

Marwan Baz profil fotoğrafı
Marwan Baz10 ay önce

@YBenlemlih The new animation posts are really nice, and they are going viral 🚀

Benzer Videolar