Date Compare Server Side Bug

Wappler 4.4.3
NodeJS 14
PostgreSQL 11

in API, we have a query that brings back date in this format: ‘2021-12-15T06:30:00.000Z’
added a condition to compare this date to NOW_UTC, the resultant check is
query.next_time > NOW_UTC ('2021-12-15T06:30:00.000Z' > '2021-12-12T06:41:56Z')
but this is returned back as FALSE!!! It should be TRUE.

did the same check on client side with this:
dmx.parse("'2021-12-15T06:30:00.000Z' > '2021-12-12T06:40:02Z'")
this was returned TRUE - as expected.

Please fix the server side issue with date comparison.

thank you.

Is this your actual expression?

query.next_time > NOW_UTC ('2021-12-15T06:30:00.000Z' > '2021-12-12T06:41:56Z')

actual expr on cond is

query.next_time > NOW_UTC

at run time the values getting replaced are:
'2021-12-15T06:30:00.000Z' > '2021-12-12T06:41:56Z'

I just tested this and it seems to work correctly:

Screenshot 2021-12-12 at 9.25.41

results in:

Screenshot 2021-12-12 at 9.25.52

in my case, the date is coming from a sql query from postgresql DB.

i tried the config that you shared - it worked - but when the date is coming from DB via query, it does not work!

Can you output the date from your database in a setvalue step and check the exact value it returns please?

2021-12-15T06:30:00.000Z

this is exactly what the DB returns - had checked by enabling output.

in the DB, the col type is timestamp, the data on that field is

2021-12-15 12:00:00.000

Can you post a screenshot of the exact output for this field from your dev tools?

image

image

1 Like

Could you test with this update, unzip to lib/core.

app.zip (4.2 KB)

sorry for checking late on this. had done a workaround for prod release.

have checked this file now. it is does fix the problem. thank you.

am hoping this will be part of the next release.