MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/btxz72/what_are_some_javascript_things_beginners_dont/ep7111g/?context=3
r/javascript • u/[deleted] • May 28 '19
383 comments sorted by
View all comments
43
Formatting dates. You don't need a bulky third party library. toLocaleDateString() will do the job in 99% of cases.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString
8 u/ProgrammingPro-ness May 28 '19 MomentJS has made me so happy over the years. 4 u/DasDoto May 29 '19 I use date-fns these days over moment. You can import only the function you need and the dates are immutable unlike moment. A lot lighter than moment as well. 3 u/ModernCannabist May 29 '19 We just switched to DayJS because it does everything MomentJS does but at about the quarter the size
8
MomentJS has made me so happy over the years.
4 u/DasDoto May 29 '19 I use date-fns these days over moment. You can import only the function you need and the dates are immutable unlike moment. A lot lighter than moment as well. 3 u/ModernCannabist May 29 '19 We just switched to DayJS because it does everything MomentJS does but at about the quarter the size
4
I use date-fns these days over moment. You can import only the function you need and the dates are immutable unlike moment. A lot lighter than moment as well.
3
We just switched to DayJS because it does everything MomentJS does but at about the quarter the size
43
u/jesusthatsgreat May 28 '19
Formatting dates. You don't need a bulky third party library. toLocaleDateString() will do the job in 99% of cases.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString