We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76b103c commit 9940504Copy full SHA for 9940504
src/panelWebView/components/Fields/DateTimeField.tsx
@@ -40,11 +40,13 @@ export const DateTimeField: React.FunctionComponent<IDateTimeFieldProps> = ({
40
const onDateChange = React.useCallback((date: Date) => {
41
setDateValue(date);
42
if (format) {
43
+ // Always use DateHelper.formatInTimezone when a format is provided
44
onChange(DateHelper.formatInTimezone(date, format, timezone) || "");
45
} else {
46
+ // Only fallback to ISO string if no format is provided
47
onChange(date.toISOString());
48
}
- }, [format, onChange]);
49
+ }, [format, timezone, onChange]);
50
51
const showRequiredState = useMemo(() => {
52
return required && !dateValue;
0 commit comments