camunda/feel-scala

Should compare date and time values with different time zones

till-stadtler opened this issue · 1 comments

Describe the bug
Date and time values can be specified by adding a time zone:

yyyy-MM-dd'T'HH:mm:ss+/-HH:mm 
yyyy-MM-dd'T'HH:mm:ss@ZoneId

These date and time values are comparable, as they describe unambiguous instants. This is reflected in the fact that the comparison does not result in null.

Here are examples of buggy behavior when comparing date and time values with time zones.

Using the same time zone via +01:00 and @Europe/Paris:

date and time("2023-03-06T16:23:00+01:00")
// returns: "2023-03-06T16:23:00+01:00"
date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: "2023-03-06T16:23:00+01:00"

date and time("2023-03-06T16:23:00+01:00") = date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: false
// expected: true
date and time("2023-03-06T16:23:00+01:00") < date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: true
// expected: false

Using different time zones describing the same instant:

date and time("2023-03-06T16:23:00+01:00")
// returns: "2023-03-06T16:23:00+01:00"
date and time("2023-03-06T17:23:00+02:00")
// returns: "2023-03-06T17:23:00+02:00"

date and time("2023-03-06T16:23:00+01:00") = date and time("2023-03-06T17:23:00+02:00")
// returns: false
// expected: true
date and time("2023-03-06T16:23:00+01:00") < date and time("2023-03-06T17:23:00+02:00")
// returns: true
// expected: false

To Reproduce
Steps to reproduce the behavior:
Enter the expressions above in the FEEL Playground

Expected behavior
Comparing date and time values with the same time zones described via +01:00 and @Europe/Paris should return the correct values when compared.
Comparing date time time values with different time zones (+02:00/+01:00, or otherwise) should return the correct values when compared.

Environment

  • FEEL engine version: 1.17.3
  • Affects:
    • Zeebe: 8.3.3

This issue is related to #560.