node-red icon indicating copy to clipboard operation
node-red copied to clipboard

Fix trigger node date handling for latest time type input

Open dceejay opened this issue 1 year ago • 1 comments

to fix #4914

  • [x] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)

Proposed changes

Fixes trigger node handling of the new time type typed input.

Checklist

  • [x] I have read the contribution guidelines
  • [ ] For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • [x] I have run npm run test to verify the unit tests pass
  • [x] I have added suitable unit tests to cover the new/changed functionality

dceejay avatar Oct 12 '24 15:10 dceejay

I've pushed a better fix for this. RED.utils.evaluateNodeProperty was already doing all the work needed to properly calculate the date values. The problem was the node was setting node.op1 to "1" if it was blank. However, blank is a valid value used to indicate it should be an epoch date. By modifying the logic to revert the defaulting of op1/op2, it's all working nicely again.

knolleary avatar Oct 21 '24 15:10 knolleary