Hello! I am struggling to write an Arcade expression that will symbolize point features based on the time value in a datetime field. I want to group the features by either AM or PM. I've tried extracting the time values using Time() which returns them as text ("08:00:00" or "12:00:00"), and then using Find() to recognize the text and return another text ("AM" or "PM"), but it's still not working (see code below):
var timeString = Time($feature.TARGET_START_DATE)
if(Find("08",timeString, 0)>-1)
return "AM"
else if (Find("12", timeString, 0)>-1)
return "PM"
this returns "AM" -- is this just the result for one feature in a feature class? because when I click Done to see if it applies itself to the dataset as a whole, I get an error message. I thought maybe it has to be in a loop, but for some reason the = in the var timeString becomes an unexpected token. I'm really stumped, and any help would be greatly appreciated!