FIX: Ensure dates passed in query params are parsed in the local timezone. (#365)

When passing date values for reports as URL parameters, they were being parsed by the standard JavaScript Date object, which due to legacy reasons parses date-only strings in UTC, all other date formats are assumed to be in the browser's local timezone.

This change switches to using moment's parser, which assumes that all strings passed to it are in the browser's local timezone.
This commit is contained in:
Gary Pendergast
2025-03-14 14:17:14 +11:00
committed by GitHub
parent e290d651f2
commit 8589c56f19
@@ -222,7 +222,7 @@ export default class ParamInputForm extends Component {
if (!value) {
return null;
}
return moment(new Date(value).toISOString()).format("YYYY-MM-DD");
return moment(value).format("YYYY-MM-DD");
} catch {
this.addError(info.identifier, ERRORS.INVALID_DATE(String(value)));
return null;