jensrossbach / node-red-contrib-chronos

Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
https://jensrossbach.github.io/node-red-contrib-chronos
MIT License
28 stars 1 forks source link

Support for durations and more in time change node #176

Closed jensrossbach closed 2 months ago

jensrossbach commented 2 months ago

This pull request brings a large extension to time change node. The biggest part of this is the support for durations (timespans / periods of time). Now it is possible to select a time mode for an instance of the time change node. The moment mode is the classic mode to deal with timestamps (moments in time) and the duration mode is the new mode to deal with timespans. In duration mode, timespans can be created by specifying a start and an end time. Timespans can also be modified by adding or subtracting a specific amount of time (similar to what is possible for timestamps) and they can be converted to different number and string formats.

Additionally, the change action Set (moment mode only) and the change actions Add and Subtract (both moment and duration modes) now support to retrieve the time portion from environment/context variables or message properties.