I'm trying to filter out events in my Feature Layer by dates. I am doing this in the ArcGIS Online Map Viewer Style expressions. It works otherwise fine, but this script won't show events that are happening today as Active:
var start = $feature.start;
var end = $feature.end;
var today = Now();
var event = When(
end >= today && start <= today, 'Active', 'Upcoming'
);
return event;
Solved! Go to Solution.
I managed to fix this myself by changing the start to this:
var alku = Date(Year($feature.alkaa), Month($feature.alkaa), Day($feature.alkaa), 0, 0, 0, 0);
The problem was that AGOL changed the time to datetime and added the default time to the date.
I managed to fix this myself by changing the start to this:
var alku = Date(Year($feature.alkaa), Month($feature.alkaa), Day($feature.alkaa), 0, 0, 0, 0);
The problem was that AGOL changed the time to datetime and added the default time to the date.