fix(marks): date input
This commit is contained in:
parent
c8f0d135f1
commit
8de86aac28
@ -6,10 +6,9 @@ export const MarkInputDateTime = ({ handler, placeholder }: MarkInputProps) => {
|
|||||||
const ref = useRef<HTMLInputElement>(null)
|
const ref = useRef<HTMLInputElement>(null)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
ref.current.value = new Date().toISOString().slice(0, 16)
|
const date = new Date()
|
||||||
if (ref.current.valueAsDate) {
|
ref.current.value = date.toISOString().slice(0, 16)
|
||||||
handler(ref.current.valueAsDate.toUTCString())
|
handler(date.toUTCString())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, [handler])
|
}, [handler])
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user