Skip to content

Commit

Permalink
Merge pull request #695 from telefonicaid/fix/format_datetime_entity_…
Browse files Browse the repository at this point in the history
…attrs_for_nosignal_event

ensure datetime attrs are in ISO format instead of epoc for nonSignal action
  • Loading branch information
fgalan committed Jun 23, 2022
2 parents 9131539 + 183c3a5 commit 77a47a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
@@ -1,3 +1,4 @@
- Fix: ensure datetime attrs from entity for nosignal events are in ISO format instead of epoc
- Add: full detail about batch update error or success in logs
- Fix: expanding an object variable in action of rule (#692)
- Fix: for EPL with context + insert + select rule (without expression) (#652)
Expand Down
6 changes: 5 additions & 1 deletion lib/models/noSignal.js
Expand Up @@ -86,7 +86,11 @@ function alertFunc(nsLineRule, entity) {
}
}
if (event[attrName] === undefined) {
event[attrName] = entity.attrs[attrName].value;
if (entity.attrs[attrName].type === 'DateTime') {
event[attrName] = new Date(entity.attrs[attrName].value * 1000).toISOString();
} else {
event[attrName] = entity.attrs[attrName].value;
}
}
});

Expand Down

0 comments on commit 77a47a9

Please sign in to comment.