Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s the closest thing we have to a useful standard library. Date handling in js without a library is a code smell.


I am confused, are you using MomentJS for fancy output like 3 days ago etc or for simple output like 5/31/2020? I can see how it is useful in former case but seems overkill in later case.


Safari is lacking in support (again) but we have `Intl.RelativeTimeFormat`[1]

    new Intl.RelativeTimeFormat("default").format(-3, "day")
1: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: