Open coopernicholas opened 4 weeks ago
I was able to get it to work by changing the following:
const filteredData = sensorData.filter((item) => {
const itemDate = DateTime.fromISO(item.dateTime, { zone: "utc" });
const start = DateTime.fromJSDate(startDate).setZone("America/Chicago");
const end = DateTime.fromJSDate(endDate).setZone("America/Chicago");
return (
item.sensorId === sensorId &&
itemDate.toString() >= start.toString() &&
itemDate.toString() <= end.toString()
);
});
I know comparing the strings may be incorrect but it is the only option.
I am trying to get a date range into a filter. It works but start always adds 5 hours to the actual time. Any help or recommendations?