mirror of
https://github.com/IT4Change/ohmyform-ui.git
synced 2025-12-13 09:45:50 +00:00
23 lines
375 B
TypeScript
23 lines
375 B
TypeScript
import dayjs from 'dayjs'
|
|
import React from 'react'
|
|
|
|
interface Props {
|
|
date: string
|
|
|
|
hideTime?: boolean
|
|
}
|
|
|
|
export const DateTime: React.FC<Props> = (props) => {
|
|
const format = props.hideTime ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm'
|
|
|
|
return (
|
|
<div
|
|
style={{
|
|
display: 'inline-block',
|
|
}}
|
|
>
|
|
{dayjs(props.date).format(format)}
|
|
</div>
|
|
)
|
|
}
|