0

我正在尝试使 MVEL 表达式起作用,但我遇到了问题。我很想确定定义为属性的日期是否介于其他两个日期之间。

props['ExistingStartDate'] >= props['current_period_start_date'] && props['ExistingStartDate'] <= props['current_period_end_date']

所以在这种情况下,我的 ExistingStartDate = 3/6/14,current_period_start_date = 3/3/14 和 current_period_end_date = 3/16/14

我期待这是真的。我觉得我的语法一定有问题。任何帮助,将不胜感激!

4

1 回答 1

0

对多个条件的每个术语使用括号:

(props['ExistingStartDate'] >= props['current_period_start_date']) && (props['ExistingStartDate'] <= props['current_period_end_date'])

此外,props引用可能没有正确的语法,具体取决于它是什么类型的 Java 对象。

于 2019-08-28T15:54:04.310 回答