({ date, format })
| 11 | }; |
| 12 | |
| 13 | const FormattedTime: FC<FormattedTimeProps> = ({ date, format }) => { |
| 14 | const formatter = useFormatter(); |
| 15 | |
| 16 | // "date" is deterministic |
| 17 | |
| 18 | const dateObject = new Date(date); |
| 19 | |
| 20 | return ( |
| 21 | <time dateTime={dateObject.toISOString()}> |
| 22 | {formatter.dateTime(dateObject, format ?? DEFAULT_DATE_FORMAT)} |
| 23 | </time> |
| 24 | ); |
| 25 | }; |
| 26 | |
| 27 | export default FormattedTime; |
nothing calls this directly
no outgoing calls
no test coverage detected