Skip to content

Commit

Permalink
#745 - Fix double date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Feb 8, 2024
1 parent 460c496 commit 06b8a57
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/panelWebView/components/Fields/DateTimeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { LocalizationKey } from '../../../localization';

export interface IDateTimeFieldProps extends BaseFieldProps<Date | null> {
format?: string;
onChange: (date: string) => void;
onChange: (date: Date) => void;
}

type InputProps = JSX.IntrinsicElements['input'];
Expand All @@ -37,11 +37,7 @@ export const DateTimeField: React.FunctionComponent<IDateTimeFieldProps> = ({

const onDateChange = React.useCallback((date: Date) => {
setDateValue(date);

const dateValue = DateHelper.format(date, format);
if (dateValue) {
onChange(dateValue);
}
onChange(date);
}, [format, onChange]);

const showRequiredState = useMemo(() => {
Expand Down

0 comments on commit 06b8a57

Please sign in to comment.