@monolith-forensics/monolith-ui 1.2.63 → 1.2.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -142,7 +142,7 @@ const ValueEditor = ({ rule, inputType, filterDef, onChange }) => {
|
|
|
142
142
|
const handleTimestampChange = useDebouncedCallback((timestamp) => {
|
|
143
143
|
let formattedValue = timestamp;
|
|
144
144
|
if (formattedValue && filterDef.resolution) {
|
|
145
|
-
const date = moment(formattedValue);
|
|
145
|
+
const date = moment(formattedValue).utc(true); // utc mode prevents datetime from shifting when using toISOString
|
|
146
146
|
switch (filterDef.resolution) {
|
|
147
147
|
case "day":
|
|
148
148
|
date.set({ hour: 0, minute: 0, second: 0, millisecond: 0 });
|
|
@@ -155,7 +155,9 @@ const ValueEditor = ({ rule, inputType, filterDef, onChange }) => {
|
|
|
155
155
|
default:
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
|
-
formattedValue =
|
|
158
|
+
formattedValue = filterDef.isoString
|
|
159
|
+
? date.toISOString()
|
|
160
|
+
: date.format(dateFormatResolver(filterDef.resolution));
|
|
159
161
|
}
|
|
160
162
|
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: formattedValue ? [formattedValue] : undefined }));
|
|
161
163
|
}, 100);
|
|
@@ -28,6 +28,7 @@ export interface FilterDefinition {
|
|
|
28
28
|
operators?: Operator[];
|
|
29
29
|
inputType?: HTMLInputElement["type"];
|
|
30
30
|
resolution?: "day" | "second" | "millisecond";
|
|
31
|
+
isoString?: boolean;
|
|
31
32
|
placeholder?: string;
|
|
32
33
|
selectOptions?: DropDownItem[];
|
|
33
34
|
editorType?: EditorType;
|