Skip to content

Commit

Permalink
tweak from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfig committed Sep 17, 2024
1 parent af822f3 commit 97e9c6e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions quadratic-client/src/app/ui/components/DateFormat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ export const DateFormat = (props: DateFormatProps) => {
}, [original, current]);

const apply = useCallback(() => {
if (!date && !time && custom) {
quadraticCore.setDateTimeFormat(sheets.getRustSelection(), custom, sheets.getCursorPosition());
} else {
quadraticCore.setDateTimeFormat(sheets.getRustSelection(), `${date} ${time}`, sheets.getCursorPosition());
}
const format = !date && !time && custom ? custom : `${date} ${time}`;
quadraticCore.setDateTimeFormat(sheets.getRustSelection(), format, sheets.getCursorPosition());
closeMenu();
}, [closeMenu, custom, date, time]);

Expand Down

0 comments on commit 97e9c6e

Please sign in to comment.