From eb8145f18e2f507a34ab13d0e721353027713ded Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Mon, 30 Jan 2023 17:35:42 -0700 Subject: [PATCH] only save date to database when closing form --- webapp/src/properties/date/date.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/src/properties/date/date.tsx b/webapp/src/properties/date/date.tsx index e6952c531..22de53fa8 100644 --- a/webapp/src/properties/date/date.tsx +++ b/webapp/src/properties/date/date.tsx @@ -61,7 +61,6 @@ function DateRange(props: PropertyProps): JSX.Element { const onChange = useCallback((newValue) => { if (value !== newValue) { setValue(newValue) - mutator.changePropertyValue(board.id, card, propertyTemplate.id, newValue) } }, [value, board.id, card, propertyTemplate.id]) @@ -150,7 +149,9 @@ function DateRange(props: PropertyProps): JSX.Element { } const onClose = () => { - onChange(datePropertyToString(dateProperty)) + const newDate = datePropertyToString(dateProperty) + onChange(newDate) + mutator.changePropertyValue(board.id, card, propertyTemplate.id, newDate) setShowDialog(false) }