Ah, OK. my wrong.
Well, I'd already put separate input and output fields so I'll probably leave it as is. It is pretty clear to users and is only 1 extra configuration input so not complex.
I uploaded a new version (v0.2.0) last night that now works just fine. In the end, the way Moment.JS works dictated some of the input/format choices. I didn't manage to get the str->obj/obj->str processing working though as I couldn't think of a way to do it. However, the answer came to me this morning so I'll change it, hopefully today & publish a v1 to NPM.
----
Thinking about whether this should be in core or not, I'm leaning towards not at present. You seem to have got along without it quite happily so far and I think it would be best for the community as a whole to keep core as small as possible.
I've actually been thinking about how you install NR. The current method seems rather clunky to me. Would it not be better to always install via NPM but have an install script that runs (written in Node.JS of course so it is cross-platform) on installation that checks for a server.js file in the installation root. If one exists then just create a redserver-template.js or something like that. If it doesn't exist, just create it. That way it would be a lot easier to install with only one way of doing it regardless of whether you were embedding it or not AND you can leave npm to do the donkey work of doing updates.
The other advantage to that approach is that you can move ALL of your core nodes to their own npm packages with the core ones included as standard in the package.json. Again, this is much easier for newcomers to work out what is happening and where things are. And you get the added benefit of being able to easily maintain the nodes separately to the main code. You can also include contrib nodes in the core delivery if you want to.
Sounds like some big wins there all for the effort of writing a single install script.
-----
On the question of what processing I'd add to the moment node. I'm really surprised nobody has asked for date/time calculations like return a date 5 days from now or a time 3 hours ago. I hate doing these in JS as they tend to be fiddly and yet they are very common UI questions. I particularly want to be able, in my home automation scenario, Turn on a light in 1 hour and turn it off again 4 hours later. I might go to extremes and say something like "turn on light1 20 minutes after sunset"! Date based calculations might be less common in the HA situation but will be very common in others.
So the UI would be to add a couple of new input fields, a number and a selection list "Seconds", "Minutes", "Hours", "Days", "Weeks", "Months", "Years". Maybe even "Week Days" and "Weekend Days". This is similar to the Trigger node "then wait" part but more comprehensive since you would want date as well as time calcs and negative inputs not just positive ones (obviously negative Trigger offsets wouldn't be sensible).
The advantage of this is that it takes out a whole bunch of JS coding if anyone ever does need a date/time offset.
----
So here is a summary of things I'd like to do with the moment node (not necessarily immediately):
- Make the default output more intelligent (obj->str/str->obj) - due today
- Publish to NPM v1.0.0 - due today
- Add a combo box to the Format field with common formats pre-populated
- Improve the error messages when Moment.JS fails to interpret the input (say why)
- Allow more input date/time formats - turns out Moment.JS doesn't really help here. At present, I see too many input failures from US/UK date formats, etc.
It would be great if I could parse "human" inputs like "tomorrow" and "2 minutes from now". We can output them now but not input them.
- Add date/time offset calculations