1
0
ohmyform/ui/components/date.time.tsx
Michael Schramm 9c4c325e5a
Switch to single branch (#221)
* remove submodules
* add api and ui files
* update github actions
* use sparse checkout
* update node setup
* update checkout
* update docker
* change permissions
* update mariadb health check
* update changelog
2023-12-02 19:22:40 +01:00

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>
)
}