You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2020/04/28 15:45:13 UTC
[unomi] branch UNOMI-329-broken-date-comparisons created (now
5967123)
This is an automated email from the ASF dual-hosted git repository.
shuber pushed a change to branch UNOMI-329-broken-date-comparisons
in repository https://gitbox.apache.org/repos/asf/unomi.git.
at 5967123 UNOMI-329 Date comparisons don't work properly in rule conditions Fixed using proper conversion of instant to date
This branch includes the following new commits:
new 5967123 UNOMI-329 Date comparisons don't work properly in rule conditions Fixed using proper conversion of instant to date
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[unomi] 01/01: UNOMI-329 Date comparisons don't work properly in
rule conditions Fixed using proper conversion of instant to date
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch UNOMI-329-broken-date-comparisons
in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 5967123b8316660f4a72aac58157adc8c3dfbc7e
Author: Serge Huber <sh...@apache.org>
AuthorDate: Tue Apr 28 17:45:06 2020 +0200
UNOMI-329 Date comparisons don't work properly in rule conditions
Fixed using proper conversion of instant to date
---
.../unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
index bb42aeb..2b5d7f1 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/conditions/PropertyConditionEvaluator.java
@@ -409,7 +409,7 @@ public class PropertyConditionEvaluator implements ConditionEvaluator {
} else {
JodaDateMathParser parser = new JodaDateMathParser(Joda.forPattern("strictDateOptionalTime||epoch_millis"));
try {
- return new Date(parser.parse(value.toString(), System::currentTimeMillis).getEpochSecond());
+ return Date.from(parser.parse(value.toString(), System::currentTimeMillis));
} catch (ElasticsearchParseException e) {
logger.warn("unable to parse date " + value.toString(), e);
}