You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I can invoke the function date() with an invalid date, for example, "2023-02-29". I expected null but the function returns the last date of the month.
To Reproduce
Steps to reproduce the behavior:
Evaluate the expression date("2023-02-29")
Verify that the result is a date at "2023-02-28"
Expected behavior
The function date() returns null if the date is invalid.
To be consistent, we should also return null for date literals, date-time literals, and the date and time() function if the date is invalid.
We don’t have a detailed use case other than parsing a date from a string coming from a request body (we do it in a few tasks).
But since we are new to feel/camunda we were experimenting with the date object and deciding if we wanted all of our date manipulations to happen within the APIs called via the REST connectors (in scala) or to keep them in the model (the easiest option).
Leap years are one of the first things you test when working with dates, so that's how we came across this issue.
But ultimately, if something has gone wrong where we have passed an invalid date to the model, we don’t want it to pick a magic date, we want it to be parsed as null so we know something is wrong somewhere
instead of possibly silently failing with the wrong date
Describe the bug
I can invoke the function
date()
with an invalid date, for example,"2023-02-29"
. I expectednull
but the function returns the last date of the month.To Reproduce
Steps to reproduce the behavior:
date("2023-02-29")
"2023-02-28"
Expected behavior
The function
date()
returnsnull
if the date is invalid.To be consistent, we should also return
null
for date literals, date-time literals, and thedate and time()
function if the date is invalid.Environment
1.17.7
The text was updated successfully, but these errors were encountered: