Read the statement by Michael Teeuw here.
Do you need to list moment and moment-timezone as dependencies in modules?
-
P.S. I did test it, and it seems to work with moment-timezone as well.
-
@dathbe you should list them , we can change the base at any time. there have been discussions to move away from moment.
we moved away from request, and etc,etc…
if you do require(x)
then you should list x in package.json -
I underline Sam’s answer. Since moment is no longer being actively developed and the Temporal API is on the horizon, I’m pretty sure
moment
will be replaced at some point. -
@KristjanESPERANTO I’ve noticed that it seems that most of the functions of moment is in vanilla javascript - at least in what we typically use.
-
@KristjanESPERANTO - while true, I also plan to replace moment when temporal is available
-
@BKeyport I couldn’t get timezones working properly. So, for example, if you want to know what day it is, and you’re not on UTC, you’re liable to pull tomorrow’s date. Maybe I don’t know how to do it, but moment is pretty lightweight and makes a few things slightly easier.
-
@dathbe you need moment.timezone
-
@sdetweil Maybe I’m wrong, and I haven’t spent a lot of time trying to test it, but I think regular moment will grab the date in the local timezone based on what is set in the system. You can’t do as much with OTHER timezones in regular moment, but I think at least that works. Whereas the regular javascript
date
will pull the date and time in UTC. That said, I do use moment-timezone in my modules–though some of them I have taken over maintaining, and they used regular moment to some success.