Skip to content

Commit

Permalink
chore: extend date default widget to not show time
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasdc committed May 23, 2024
1 parent 61a53cc commit ceecc20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/components/Review/ReviewTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DefaultWidget from './widgets/DefaultWidget';
import MoneyWidget from './widgets/MoneyWidget';
import BooleanWidget from './widgets/BooleanWidget';
import FileWidget from './widgets/FileWidget';
import DateWidget from './widgets/DateWidget';

const { templates } = getDefaultRegistry();

Expand All @@ -36,6 +37,7 @@ const ReviewTheme: ThemeProps = {
ReadOnlyWidget: DefaultWidget,
ReadOnlyProjectAreaWidget: DefaultWidget,
ReadOnlyProjectAreaWidgetIntakeFour: DefaultWidget,
DateWidget,
},
templates: {
...templates,
Expand Down
8 changes: 8 additions & 0 deletions app/components/Review/widgets/DateWidget.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { WidgetProps } from '@rjsf/utils';

const DateWidget: React.FC<WidgetProps> = ({ value }) => {
const date = value?.toString().split('T')[0];
return <>{date}</>;
};

export default DateWidget;

0 comments on commit ceecc20

Please sign in to comment.