I'm trying to check if the year from a field in a layer corresponds to this year.
I'm able to do it with format-date() but I need to do it with decimal-date-time() because I want the form to work on the web app.
today_ddt = field that contains today's year in decimal date time
field_year = field that contains an inspection date (that I ultimately with to compare to today_ddt)
| type | name | label | calculation | bind::type | RESULT survey123 connect | RESULT web app |
| text | today_ddt | today_ddt | decimal-date-time(today()) | int | 53 | 53 |
| text | field_year | field_year | int(decimal-date-time(int(pulldata("@layer", "getValue", "attributes.inspection_date", "https://service_url/FeatureServer/14?orderbyfields=inspection_date desc", concat("field1 =", ${field1})))) div 365.25) | int | 53 | 1690905600000 |
I get that 53 + 1970 = 2023 and I don't mind wether I get a 53 or 2023, but it has to be the same format for both. I want to compare them but I can't seem to do it because web app always gives a different result than connect.
I tried all the possibilities changing "type" to integer, text or date; "bind::type" to int or nothing, adding/removing int(); dividing by 365.25 or not..
Help?