5 ms·
moment.js is so annoying because if I don't do momentObject.clone() everywhere I end up having many unwanted side-effects.
by SwiftyBug 6y ago
moment.js is so annoying because if I don't do momentObject.clone() everywhere I end up having many unwanted side-effects.
- flipchart 6y agoI've been burned by this so many times! Code that uses moment is written, tested, and then never touched to make sure you stay sane
- ryzokuken 6y agoThe Temporal API is immutable, so you won't have to deal with it anymore.
- Roboprog 6y agoI have been lucky, then. I pulled in moment about 5 years ago into our group’s stack, but we mostly use it for parsing and formatting date (only) strings for date arithmetic. The government vital records forms we are working with seldom deal with time of day, and when they do, it’s an optional string down to minutes resolution only. I guess all the converting to and from strings coincidentally protected me from mutability. Good to know.