I created a Survey123 for road construction which includes two date type fields, one for when the construction begins and one field for when the construction ends, and I want to symbolize the features using those two date fields. Specifically I want to symbolize the features by what happened last week, "Construction Started Last Week", "Construction Ended Last Week", "Construction Was Active Last Week", and an "Other" symbology for those features whose start construction date and end construction date are outside the last week parameters.
//Here is an expression I tried to use to symbolize this, but it didn't work, every feature had "Other" symbology:
var startedlastweek = DateDiff(Now(), $feature.start_closure,'days');
var endedlastweek = DateDiff(Now(), $feature.end_closure, 'days');
If (startedlastweek >= 1 && startedlastweek <= 7) {
return "Active last week"
}
else if (endedlastweek >= 1 && endedlastweek <=7) {
return "Ended Last Week"
} else{
return "Other"
}
Thank you for the help!