File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ const propTypes = {
77 PropTypes . string . isRequired ,
88 PropTypes . instanceOf ( Date ) ,
99 ] ) ,
10+ // eslint-disable-next-line react/forbid-prop-types
11+ options : PropTypes . object ,
1012} ;
1113
12- function DateTime ( { value } ) {
14+ function DateTime ( { value, options } ) {
1315 const intl = useIntl ( ) ;
1416
15- return useMemo ( ( ) => {
16- return intl . dateTime ( value ) ;
17- } , [ intl . locale ] ) ;
17+ return useMemo ( ( ) => intl . dateTime ( value , options ) , [ intl . locale ] ) ;
1818}
1919
2020DateTime . propTypes = propTypes ;
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ import useIntl from '../hooks/useIntl';
44
55const propTypes = {
66 value : PropTypes . number . isRequired ,
7+ // eslint-disable-next-line react/forbid-prop-types
8+ options : PropTypes . object ,
79} ;
810
9- function Number ( { value } ) {
11+ function Number ( { value, options } ) {
1012 const intl = useIntl ( ) ;
1113
12- return useMemo ( ( ) => {
13- return intl . number ( value ) ;
14- } , [ intl . locale ] ) ;
14+ return useMemo ( ( ) => intl . number ( value , options ) , [ intl . locale ] ) ;
1515}
1616
1717Number . propTypes = propTypes ;
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ const propTypes = {
77 PropTypes . string . isRequired ,
88 PropTypes . instanceOf ( Date ) ,
99 ] ) ,
10+ // eslint-disable-next-line react/forbid-prop-types
11+ options : PropTypes . object ,
1012} ;
1113
12- function TimeAgo ( { value } ) {
14+ function TimeAgo ( { value, options } ) {
1315 const intl = useIntl ( ) ;
1416
15- return useMemo ( ( ) => {
16- return intl . timeAgo ( value ) ;
17- } , [ intl . locale ] ) ;
17+ return useMemo ( ( ) => intl . timeAgo ( value , options ) , [ intl . locale ] ) ;
1818}
1919
2020TimeAgo . propTypes = propTypes ;
You can’t perform that action at this time.
0 commit comments