Sure I can var tz = Intl.DateTimeFormat().resolvedOptions().timeZone // 'Europe/London however it should be implicit (i.e. leave it blank to use system).
Is there a reason you would expect it to be populated by default?
Very nice and easy to use plugin. I really like the yellow info box telling what is going to happen.
I was thinking about an input on the node where you could enable/disable the cron timer. That could be quite handy?
I kind of like the node status, but it becomes quite long. If the node is used in a crowded flow it's a little overwhelming and might go on top of other nodes. Maybe an option where you can choose a short version would be useful (maybe without date and timezoneinfo?)
Like an input connection on the left so that you can send it control messages e.g. msg.topic = "stop"?
A tick box option would be possible yes. Please add an issue to the repo so it doesnt get forgotten.
That is harder than it sounds - I could I suppose hide the date if its the same day (but then what is the same day when you're dealing with timezones aaaarrggg )
This needs thought.
Perhaps the option to turn off the node status will have to do for now.
Like an input connection on the left so that you can send it control messages e.g. msg.topic = "stop" ?<
Something like that. Maybe msg.enabe would be more descriptive?
That is harder than it sounds - I could I suppose hide the date if its the same day (but then what is the same day when you're dealing with timezones aaaarrggg )<
What about an option for showing relative time? Eg:
Next Run: ~1d
Next Run: ~7h
Next Run: ~2m
Then you change the accuracy the closer you get to the trigger time.
So Steve - looks great and a hell of a lot of effort - could you clarify for me - is this part of the system cron process and is manipulating that tables of entries or is this standalone and is only for node-red functions ? i.e. is it (essentially) cron functionality ported into node-red for scheduling - or is it node-red tapping into the cron daemon to manipulate its list of jobs ??
Nice, this node is somewhat reminiscent to the later node.
A combination of the 2 would be nice. (ie. an input).
Personally I don't see the use for the timezone, could actually become confusing once you have 5 nodes on your flow and apply individual timezones to them (although I wonder who would use it).
Ideally it would be a reusable node that holds a list with of cron-jobs, each with their own 'topic', where a schedule can be added/removed via input. Outputs a timestamp & topic.
On the other hand, the expression part would also be nice to integrate on the current inject node.
Certainly being able to select local timezone or GMT can be useful. One may want something that happens the same time every day and is not affected by DST. Being able to select a particular timezone may be useful where the server is running in a different timezone to the user (a server in the cloud for example).
I am considering the idea of adding a "cron table" (I would need some pointers with the ui elements though)
I was thinking along the lines of each node has a one timezone & each cron table entry has
topic (for the user to understand which job is triggering)
payload (what to send)
something else???
Design thoughts...
The UI could permit the user to enter the topic+schedule then an add button to add to the "cron table". Each item would be able to be selected (for editing) and removed/deleted.
I'd likely have to remove the inject button as i dont see how it would make any sense with a table of schedules.
Anyone got ready made a simple for making this work? The backend code will be pretty easy & quick to realise.