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

Add possibility to specify comparison precision for time switch and filter node #174

Closed jensrossbach closed 2 months ago

jensrossbach commented 2 months ago

This pull request adds the possibility to specify the precision for time comparisons in time switch and filter nodes (previously, comparison was always on millisecond precision). The precision is applicable to the operators before, after, between and outside as well as to the new operators ==, !=, until and since. The new operators have been added to have more comparison flexibility in case of lower comparison precisions. The precision ranges from the granularity of milliseconds up to the granularity of years. Additionally, the new JSONata function $isSame() corresponding to the == operator has been added. The functions $isBefore(), $isAfter(), $isBetween() and $isOutside() have been updated to work with precisions, too.

‼️ Breaking Changes ‼️