File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function TextOutput(props: Props) {
6565 } = props ;
6666
6767 const { value : propValue } = props ;
68- let valueComponent : React . ReactNode = propValue || invalidText ;
68+ let valueComponent : React . ReactNode = invalidText ;
6969
7070 if ( otherProps . valueType === 'number' ) {
7171 valueComponent = (
@@ -91,6 +91,8 @@ function TextOutput(props: Props) {
9191 invalidText = { invalidText }
9292 />
9393 ) ;
94+ } else if ( ! ( propValue instanceof Date ) ) {
95+ valueComponent = propValue || invalidText ;
9496 }
9597
9698 return (
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { _cs } from '@togglecorp/fujs';
33import NumberOutput , { Props as NumberOutputProps } from '#components/NumberOutput' ;
44import BooleanOutput , { Props as BooleanOutputProps } from '#components/BooleanOutput' ;
55import DateOutput , { Props as DateOutputProps } from '#components/DateOutput' ;
6+ import { DEFAULT_PRINT_DATE_FORMAT } from '#utils/constants' ;
67
78import styles from './styles.module.css' ;
89
@@ -59,7 +60,7 @@ function TextOutput(props: Props) {
5960 } = props ;
6061
6162 const { value : propValue } = props ;
62- let valueComponent : React . ReactNode = propValue || invalidText ;
63+ let valueComponent : React . ReactNode = invalidText ;
6364
6465 if ( otherProps . valueType === 'number' ) {
6566 valueComponent = (
@@ -75,6 +76,7 @@ function TextOutput(props: Props) {
7576 // eslint-disable-next-line react/jsx-props-no-spreading
7677 { ...otherProps }
7778 invalidText = { invalidText }
79+ format = { DEFAULT_PRINT_DATE_FORMAT }
7880 />
7981 ) ;
8082 } else if ( otherProps . valueType === 'boolean' ) {
@@ -85,6 +87,8 @@ function TextOutput(props: Props) {
8587 invalidText = { invalidText }
8688 />
8789 ) ;
90+ } else if ( ! ( propValue instanceof Date ) ) {
91+ valueComponent = propValue || invalidText ;
8892 }
8993
9094 return (
Original file line number Diff line number Diff line change 11import { type components } from '#generated/types' ;
22
3- export const DEFAULT_DATE_FORMAT = 'dd-MM-yyyy' ;
3+ export const DEFAULT_DATE_FORMAT = 'yyyy-MM-dd' ;
4+ export const DEFAULT_PRINT_DATE_FORMAT = 'dd-MM-yyyy' ;
45
56// Alert
67
You can’t perform that action at this time.
0 commit comments